From: MonkeeSage Date: 2006-09-25T04:45:11+09:00 Subject: Re: Riddle me this (a question about expressions) Patrick Toomey wrote: > Someone else gave the example of simplifying my question down to the > equivalent of trying the following > > x = return 9 > > Why shouldn't this be valid? As shown above, raise seems to return > nil, and return seems like it should return a similar value if there > is no other reasonable return value. Just for my own curiosity, what > implications would returning "nil" have? Anyway, thanks for all your > help. I realize most of this is of academic value, but it really > helps to see how Ruby works underneath. Hi Patrick, I've no idea what goes on under the hood, but I would think it is because raise doesn't exit the current stack frame (it can be rescued and execution continues), so it's more like a method that gets evaluated and its return (nil) then gets assigned (nb: right hand side of assignment is always resolved before it is assigned). But return (and I assume break / next) break out of the current stack frame, so the assignment is left dangling. That's my guess. Regards, Jordan