[PRL] Type question...

Carl Eastlund cce at ccs.neu.edu
Wed Oct 3 23:25:05 EDT 2007


I believe it's the (f f n) and (g g (- m 1)) that shoot you down.
There's no simple type for a function that accepts itself as an
argument.

--Carl

On 10/3/07, Bryan Chadwick <chadwick at ccs.neu.edu> wrote:
>    Quick question.   After thinking about a complex lambda term (really
> just a poor man's recursion),  I don't think it can be hand annotated
> with simple types (if the language was extended to do so).
>
> Is this correct?  Thoughts?
>
> Here's factorial without letrec...
>
> (let ((fact (lambda (num)
>                 ((lambda (f n) (f f n))
>                  (lambda (g m)
>                    (if (< m 2) 1
>                        (* m (g g (- m 1))))) num))))
>    (fact 5))
>
>
> Thanks,
> Bryan.



More information about the PRL mailing list