On Fri, 1 Jun 2001 15:31:40 +0900
matz / zetabits.com (Yukihiro Matsumoto) wrote:

> I don't mean "<...>" is the best.  It's uglier.  But it's compatible
> and easy-to-use.

What about "(...)"?
Since it will be more def-arguments-like, it would be cool if it has the same syntax.

titi.each do (name, value)
	...
end

Is there a way to avoid confusion between these arguments and an expression in brackets?

It might be restricted to the same line as the begining of the block (like defs, arguments can't be on the next line):

titi.each do (name, value) # block arguments
end
titi.each do # no arguments (explicit: "()")
	(name, value) # expression
end

The only broken code seems to be when you have something like:
10.times do (a + b).tata end
But it might be detectable by the parser and not interpreted as arguments?
Else, it can be fixed by moving the expression to the next line.

Anyway, if it is not feasible, I still prefer "<...>". It doesn't look uglier than "|...|" to me.


Mike.
midulo.