Project

General

Profile

Actions

Bug #8224

closed

defined?(()) and defined? () are inconsistent

Added by Anonymous about 11 years ago. Updated about 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-04-05 trunk 40128) [x86_64-darwin11.4.0]
Backport:
[ruby-core:54024]

Description

=begin
(({defined?(())})) and (({defined? ()})) return different values.

I would there to be no difference between (({defined? })) and (({defined?()})), except for precedence.

Example:

defined?( () ) # => "expression"
defined?  ()   # => "nil"

=end


Related issues 1 (0 open1 closed)

Precedes Backport200 - Backport #8220: Segmentation fault when providing defined? operator with empty parenthesesClosednagachika (Tomoyuki Chikanaga)04/06/201304/06/2013Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40138.
Charlie, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


parse.y: "nil" for defined? with empty expression

  • parse.y (new_defined): remove all extra parentheses, and return
    "nil" for defined? with empty expression.
    [ruby-core:54024] [Bug #8224]
Actions

Also available in: Atom PDF

Like0
Like0