[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:04255] Re: RTFM and/or parser question

From: matz@... (Yukihiro Matsumoto)
Date: 2000-07-28 16:30:03 UTC
List: ruby-talk #4255
Hi,

In message "[ruby-talk:04250] RTFM and/or parser question"
    on 00/07/28, "Sergey Abel" <abel_sm@mtu-net.ru> writes:

|Excuse me, but I'm not satisfied with the following
|example and its explanation in the ruby FAQ:

|p(nil or "")    # parse error

|p( (nil or "") )  # parse ok
|
|Maybe, there's something wrong with the parser?
|If not, then we definitely need the more strict syntax definition.

No, parser works fine.  It's precedence matter.  `or' operator is
classified as a statement which cannot appear as an argument which
should be an expression.  A statement surrounded by parenthesises is
an expression.  Thus the latter is legal.  yacc.html in the reference
explain this, in kind of obfuscating notation.

FAQ description may be inexact.  Suggestion is welcome.

							matz.

In This Thread

Prev Next