[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01114] Re: The value of while...

From: Dave Thomas <Dave@...>
Date: 2000-01-12 06:14:04 UTC
List: ruby-talk #1114
matz@netlab.co.jp (Yukihiro Matsumoto) writes:

> |It's more the philosophical thing - we say that they are expressions,
> |and they generate values like expressions, but you can't use them as
> |expressions. Ruby's pretty good at being orthogonal, but it breaks
> |down a bit here.
> 
> But using the value of void expression is clearly an error.  I think
> it'd be reported somehow.   By warning?

I guess my point is that this is the only place the concept of 'void
expression' appears. It is otherwise not expressible as a value, nor
can you test for it (a.void?).

This is really not a big deal - I was just trying to write down a
description of Ruby, and I wrote 'everything is an expression' and
then stopped to think. I'm sure you've got way better things to think
about. (Although I still quite like the idea of 'break' returning a
value ;-)

Dave




In This Thread