On Mar 3, 2013, at 1:28 PM, Sven Olsen <sven2718@gmail.com> wrote:
print( config.color? ) --> should print false not nil
This is the big potential drawback I can see for my _SAFE approach. While the syntax is shared with CoffeeScript's existential operator, the semantics are different. As I'm defining it, ? is a utility for safe table navigation -- it shouldn't be used to check for existence. "config.color?" is prettymuch guaranteed to never be nil or false, as it's just shorthand for "(config.color or _SAFE)".
You could have the patch do this:function __check(expr)if type(expr)=='boolean' thenreturn exprelsereturn _SAFEendend
and convert:expr? to (expr or __check(expr))