From: Reid Thompson Date: 2006-10-27T21:48:48+09:00 Subject: Re: Ruby Design Principles Joel VanderWerf wrote: > Yukihiro Matsumoto wrote: >> Hi, >> >> In message "Re: Ruby Design Principles" >> on Fri, 27 Oct 2006 03:50:19 +0900, Bil Kleb >> writes: >> >> |Anyone have the link for the slides? (The movie has very >> |high compression.) >> >> http://www.rubyist.net/~matz/slides/byu/ > > Is it really fair to say that the ruby program > > print *ARGF > > is the same as /bin/cat? When used interactively they are different: > > $ cat cat.rb > print *ARGF > $ ruby cat.rb > 1 > 2 > 3 > 1 > 2 > 3 > $ cat > 1 > 1 > 2 > 2 > 3 > 3 > $ ruby -e 'ARGF.each{|line| print line}' > 1 > 1 > 2 > 2 > 3 > 3 > > Also, with a lot of input, the memory usage will be very different, > since 'print *ARGF' slurps all input. > > But even 'ARGF.each{|line| print line}' is a lot shorter than 50 lines > of C! > :) but how many lines of C are hidden behind that 'ARGF.each{|line| print line}'