All,
I've attached a patch for the documentation for
Struct::new.
The second edition of The Pickaxe Book says:
> Ruby 1.9 and later allow you to pass a block to a
Struct's constructor.
> This block is evaluated in the context of the new
struct's class and hence
> allows you conveniently to add instance methods to the
new struct.
It turns out that this functionality has actually been
present since 1.8.3!
This is the relevant ChangeLog entry:
http://svn.ruby-lang.org/cgi-bin/view
vc.cgi/trunk/struct.c?view=log#rev5934
(although it references [ruby-talk:02606], it should really
be
[ruby-core:02606]:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/rub
y/ruby-core/2606
I've tried to stick to the submission guidelines, but please
let me know if
I've screwed anything up!
Cheers,
------------------------------------------------
Paul Butcher
CTO
Texperts
Mobile: +44 (0) 7740 857648
Main: +44 (0) 1223 309080
Fax: +44(0) 1223 309082
Email: paul texperts.com
MSN: paul paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
LinkedIn: http://www.lin
kedin.com/in/paulbutcher
------------------------------------------------
Re5ult Limited Registered in England No 04909795 VAT
registration number
GB 849 201 231. Registered office 22 Great James Street
bondg WC1N 3ES
This email is confidential. It may be read, copied and used
only by the
intended recipient. If you have received it in error, please
contact us
immediately.
|