[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:02840] Re: Loops should return a value - part II

From: matz@... (Yukihiro Matsumoto)
Date: 2000-05-16 16:19:51 UTC
List: ruby-talk #2840
Hi,

In message "[ruby-talk:02836] Loops should return a value - part II"
    on 00/05/16, Dave Thomas <Dave@thomases.com> writes:

|A discussion about expression languages and Algol68 led me to think
|about Ruby loops returning values. I had a look at the parser, and
|discovered: 
|
|    a = (while i < 10; i += 1; end)  #-> void value expression
|
|    a = begin; while i < 10; i += 1; end; end  #-> nil
|
|In the latter case, 'while' is treated as if it returned 'nil'.
|
|Just a curiosity...

Ruby parser is not trying hard to find `voild value expression'.
Mostly because the author is lazy.

							matz.

In This Thread

Prev Next