Currying Unrestricted Functions

Standard functions operate by currying. A well understood process. And zero-argument functions fit into this system well. When called with an argument they ignore it and the argument is passed to their return value as one might expect. However, unrestricted functions don't fit well into currying. First, how does one say that something is the last argument to the unrestricted function and the rest of the arguments should be passed to its return value? This isn't a big problem since one can always enclose it in parenthesis to clarify this. The big problem is, how does one indicate there are more arguments to be passed after the end of the current list?

An add hock solution is to make programmers write something such as:

(lambda more-args (apply unrestricted-function (append args more-args)))

However, this seems unsatisfactory. My first thought was to pass the last argument dotted as (f a1 a2 a3 . a4) but this doesn't work if the last argument must be a list as (f a1 a2 a3 . (g 2)). Here the items g and 2 will be passed and f still won't be curried.

Maybe the list of arguments could be terminated with #void like (function arg1 arg2 arg3 . #void). This solution requires literal constants.

Resolution

Since literal constants were added to the language using #void seemed a reasonable choice.



jwalker@cs.oberlin.edu