R.
--
Ne baisse jamais la tête, tu ne verrais plus les étoiles.
Robert Dober
In English, I woud say..
jump and shout unless someone is sleeping.
Ruby is so elegant that I fidng myself wanting to write similarly,.
jump and shout unless someone.sleeping?
Ruby isn't English, though.
Just wish it's was interpreted as such
It is; it's just that puts returns nil, so it doesn't pass through the
and gate. I don't think the word "and" just to mean "and then execute
this" would be very useful.
David
···
On Fri, 5 Dec 2008, List.rb wrote:
On Dec 4, 2008, at 3:51 PM, "Robert Dober" <robert.dober@gmail.com> wrote:
--
Rails training from David A. Black and Ruby Power and Light:
INTRO TO RAILS (Jan 12-15), Fort Lauderdale, FL
See http://www.rubypal.com for details
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2\)
I do not think highly of the following code in general, but if this is
about some literal programming idea it might come in handy. Children
just do not use it when home alone
irb(main):010:0> class Object
irb(main):011:1> def and &blk
irb(main):012:2> blk.call
irb(main):013:2> end
irb(main):014:1> end
=> nil
irb(main):015:0> puts( 42 ).and { puts 42 }.and { puts 42 }
42
42
42
Cheers
R.
···
On Thu, Dec 4, 2008 at 11:28 PM, David A. Black <dblack@rubypal.com> wrote: