[Date Prev] [Date Next] [Thread Prev] [Thread Next] Indexes: Main | Date | Thread | Author

Re: [ba-unrev-talk] Humble pie in academia

stephen white wrote:    (01)

> STDIN.readline is the equivalent of $_, but it's
> cooler to use an iterator on STDIN, eg:
>    STDIN.each {|line| puts line }    (02)

Yes, I have to admit that is *way* cool. Their ability to pass
code blocks as parameterized objects creates this kind of killer toy.    (03)

But the fact that $_is an automatic parameter to anything that
doesn't have one means that if you coded "puts", you'd get those
lines. God only knows what other functions wind up getting called
on $_ when you forget to code an argument. (It's probably a minor
weakness, but still a weakness.    (04)

I see why it grabbed your attention, though. It's pretty darn cool.
Hmmm. I wonder if I can extend Ruby to create functions that
use Java's sound synthesizer??    (05)