[racket] higher-order-primitive
At Wed, 29 Dec 2010 09:43:56 -0500, Stephen Bloch wrote:
> Is there a way to define/provide a higher-order primitive (i.e. a
> higher-order function that can be used in Beginning Student) with
> variable arity?
I think you have to define a macro that expands to use
`first-order->higher-order' around the arguments that should be allowed
as procedures.
For example, if you want a primitive `P', then define `P' as
(define-syntax-rule (P e ...)
(real-P (first-order->higher-order e) ...))
and implement the function as `real-P'.