So it seems I understood it correctly.
My implementation of a Y-like combinator,
(define (y f) ((lambda (x) (f (delay (x x (lambda (x) (f (delay (x
x))
works well - except that the combinated function needs to call ((force f)
...) instead of (f ...)
Guess I just missed the part where Hal m
SICP's treatment of the Y combinator is uninformed by existing programming
language theory (1960s and 70s stuff) and is therefore wrong. To their credit,
they allude to the problem with words such as normal-forms, reduction, and
applicative etc. That's wrong too but at least it warns readers of
Look up the difference between the call by name and call by value Y combinator.
Jay
On Wed, Aug 4, 2010 at 10:20 AM, The Configurator
wrote:
> I'll hijack the thread since I've been meaning to ask about the Y
> combinator.
> From SICP I've seen that the Y combinator is the function
> (define (y
I'll hijack the thread since I've been meaning to ask about the Y
combinator.
>From SICP I've seen that the Y combinator is the function
(define (y f)
((lambda (x) (f (x x)))
(lambda (x) (f (x x)
This makes mathematical sense, since
(y f)
= ((lambda (x) (f (x x))) (lambda (x) (f (x x
The use of the Y combinator (as opposed to the built-in forms of
recursion) seems to be hacking around the ability for Ruby methods to
be redefined more than anything?
Robby
On Sat, Jul 31, 2010 at 8:54 PM, Shriram Krishnamurthi
wrote:
> ...provide a mis-feature that the language thoughtfully l
...provide a mis-feature that the language thoughtfully left out:
http://www.eecs.harvard.edu/~cduan/technical/ruby/ycombinator.shtml
(The bit about "lexical" scoping in Ruby is also neat. It says that
deep down, Ruby really is the same as JavaScript and Python.)
Shriram
___
6 matches
Mail list logo