Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Functional > Re: the necessi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2765 of 2841
Post > Topic >>

Re: the necessity of Lisp's Objects?

by Joost Diepenmaat <joost@[EMAIL PROTECTED] > Feb 10, 2008 at 11:41 PM

"David Formosa (aka ? the Platypus)" <dformosa@[EMAIL PROTECTED]
> writes:

> Likewise perl supports it.
>
> my $fib;
> $fib = sub {
>   my $i = shift;
>   return 1 if ($i <= 1);
>   return $fib->($i-2) + $fib($i-1);
> };

Yes, but that relies on declaring the $fib lexical variable before
assinging the function to it. IIRC the point of the Y-combinator (and
callee) is that you don't have to do that.

Not that there's anything wrong with this approach.

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/
| work: http://zeekat.nl/




 1 Posts in Topic:
Re: the necessity of Lisp's Objects?
Joost Diepenmaat <joos  2008-02-10 23:41:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 21:36:13 CDT 2008.