From the lambda calculus we have functions taking only one argument. Through currying we develop multi-argument functions. However, where do Unrestricted and Zero-Argument functions come from?
Perhaps macros are used to invisibly achieve these effects?
Zero argument and unrestricted functions can indeed be implemented through macros as:
(define lambda-0
(mu ()
( [<body> ...]
(let [(f (lambda (unused) <body> ...))]
(mu ()
( [<args> (... ...)]
(f 'unused <args> (... ...)))
)))))
(define lambda-u
(mu ()
( [ <arg> <body> ...]
(let [(f (lambda (<arg>) <body> ...))]
(mu ()
( [<args> (... ...)]
(f (list <args> (... ...))))
)))))
We can just say that these are hidden from the user. One question that remains is: What is the primitive form of mu? Lambda in Better Scheme can now be built from the lambda of the lambda calculus, but what is the simplest form of mu needed?
jwalker@cs.oberlin.edu |