[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Or Alternatively ... ?



Possibly extend the definition of procedural evaluation to allow the
syntactic decomposition of a list of values into a sequence of values
then evaluated as arguments, in a manner somewhat analogous to the use
of unquote-splicing to enable:

  (<proc> . (<value> ...) ...) :: (<proc> <value> ...)

Such that doted arguments are evaluated and spliced prior to procedural
evaluation:

  (define some-values '(1 2 3))

  (+ . some-values) :: (+ 1 2 3) => 6

  (+ . some-values . '(10 20)) :: (+ 1 2 3 10 20) => 36

Where then further:

  (let ([(a . b) some-values]) (+ a . b . '(10 20))) => 36

  (+ . some-values . (lambda () (list 10 20))) => 36

And correspondingly:

  (define (function-values) (list 10 20))

  (+ . some-values . (function-values)) :: (+ 1 2 3 10 20) => 36

Thereby enabling the (values ...) construct et al. to be eliminated.