[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Applicative languages? Anyone?
>2) Some syntactic means for preventing argumentsfrom getting unreadably
> numerous just to pass something down to where it's finally used.
This is an interesting issue. I can think of two solutions right
away:
1. Package up all the arguments into a data structure (say an
association-list or an object), and then you only need to pass around
one data structure. (A good way to implement this data structure
would be as a "frame" a la Abelson and Sussman. I have tried earlier
to lobby for a "make-frame" primitive, like the "make-environment"
primitive, but was unsuccessful).
2. If this passing around of arguments is happening internal to a
function, use lexical scoping. Say f is a function that needs n
arguments. Define it as
(define (f x1 x2 ... xn)
(define (local-function1) ...)
...
(define (local-functionk) ...)
...)
The arguments x1,...,xn need not be passed to every local-function.
What is wrong with these solutios? Perhaps there is a different
problem that you have in mind, but haven't stated precisely yet.
Uday Reddy
University of Illinois