Y Ruby.

John Carter — 2002-05-22 05:55:40

Whilst looking for something entirely different I came across this
very interesting fragment.

Takaaki Tateishi(ttate@...) has been playing Joy-like dirty
tricks in the Ruby (www.ruby-lang.org) scripting langauge...

http://kt-www.jaist.ac.jp/~ttate/ftp/rec.rb

It is an example of defining a recursive Proc object using Y
combinator.

I'm very impressed.

The Programming Ruby book is helpful in trying to understand what Takaaki
is doing..
http://www.rubycentral.com/book/ref_c_proc.html
http://www.rubycentral.com/book/ref_m_kernel.html#Kernel.proc



John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@...
New Zealand

May contain traces of nuts. This email was packed by mass, not
volume. Contents may have settled during distribution.
This email is not designed or intended for use in on-line control of
aircraft, air traffic, aircraft navigation or aircraft communications; or in
the design, construction, operation or maintenance of any nuclear
facility. Reader represents and warrants that it will not use or
redistribute the email for such purposes.