Issue #6270 has been updated by drbrain (Eric Hodel).


=begin
This syntax seems too similar to the ?a character string syntax

Currently ?a returns "a", so how would the parsing of this expression change:

  true ??a:?b

Which currently returns "a", or:

  question_method??a

Which currently parses the same as:

  question_method? "a"
=end
----------------------------------------
Feature #6270: add "??a" support for "not defined?(a) or a.nil?"
https://bugs.ruby-lang.org/issues/6270#change-25722

Author: jacksonwillis (Jackson Willis)
Status: Open
Priority: Low
Assignee: 
Category: 
Target version: 3.0


It would work like this:

    ??foo #=> nil

    foo = nil

    ??foo #=> nil

    foo = 3

    ??foo #=> true

Not sure if this would be useful, just a suggestion.


-- 
http://bugs.ruby-lang.org/