Tag: postfix notation

`定义?`和`除非’没有按预期工作

我期待以下片段: var = “Not Empty” unless defined? var var # => nil 返回”Not Empty” ,但我nil 。 任何洞察为什么会发生这种情况?