My friend shows this to me, and I am really curious why it works like this. I at first thought that it's gonna be a syntax error, but it doesn't... Here're some of my experiments:
> (lambda lambda lambda)
#<procedure>
> ((lambda lambda lambda))
'()
> ((lambda lambda lambda) 1 2 3 4 5 6 7)
'(1 2 3 4 5 6 7)
> (lambda lambda foo)
#<procedure>
> ((lambda lambda foo))
foo: undefined;
cannot reference an identifier before its definition
> (lambda lambda 1 2 3 4 5)
#<procedure>
> ((lambda lambda 1 2 3 4 5))
5
> (lambda foo lambda)
. lambda: bad syntax in: lambda
> (lambda 1 2 3)
. lambda: bad argument sequence in: 1
> ((lambda) 1 2 3)
. lambda: bad syntax in: (lambda)
So it seems:
- In
lambda
,lambda
could be arg-ids? - In
lambda
,lambda
could be a list constructor?
rest-id
as well in 4.4.1, but I didn't see it! – Spinoza