[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ARGUMENTS/VALUES -> CONSUME/PRODUCE
Date: Fri, 8 Sep 89 15:55 EDT
From: Kent M Pitman <KMP@stony-brook.scrc.symbolics.com>
...
Actually, CONTINUE seems to me to be the right name for VALUES, not
for CALL-WITH-VALUES!
...
For CALL-WITH-VALUES, I suggest the name should be
(CALL-WITH-CONTINUATION fn continuation)
where the idea would be to think of the second function as effectively
promoted to the status of a continuation. (When that continuation `runs out,'
the current continuation receives its values.)
(CALL-WITH-CONTINUATION (LAMBDA () (CONTINUE 1 2)) CONS)
=> (1 . 2)
I think this has a very nice look to it.
Very nice indeed. A lot worse ideas have appeared (including mine).
Notice that the idiom for returning no values is thus (CONTINUE).
And I can write
(DO ((J 0 (+ J 1)))
((= J 10))
(DISPLAY J)
(DISPLAY (SQRT J))
(CONTINUE))
But I like it anyway.
Note that a "real" continuation can, if desired, be used as the
second argument to CALL-WITH-CONTINUATION, n'est-ce pas?
--Guy