From: pcs3@... Date: 2001-11-03T06:20:01+09:00 Subject: [ruby-talk:24205] Re: "yield called out of block" > Well, that would leave us needing a new word for what used to be > "yield" :-) I don't think that values in CL does what yield does, > does > it? Wouldn't this (returning multiple values) be closer? > > def thing > return 1,2,3 > end Yes it would. I wasn't suggesting we eliminate yields primary purpose, just that we modify it in one case (that case being when no block is supplied). Either to return multiple values as you have shown above by collecting them into an array and returning that object, which would probably be easier to implement, or to do what the CL values does and return them as true seperate values (which would allow you to take the first and ignore the rest), does Perl have something similar to this? Having yield collect everything into an array (when no block is supplied) would save typing in all those cases where that's all you were really using the iterator for anyways. > In any case, yield and related iterator behavior are very central to > Ruby; I doubt they're in flux or under consideration for elimination. > At least, I hope not :-) So do I.