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

Re: define and set! with multiple-values I think I've changed my mind.

    Date: Mon, 4 Jan 93 10:47:38 EST
    From: bhyde@gensym.com (Ben A. Hyde)
      As far as I know it is not possible to implement safe
    multiple values with out requiring many functions also set a value
    count.  Thus:
      (defun foo (x)
        (+ x x))
    must set the value count to as well as do the tiny bit of work
    required to do the addition.  Meanwhile
      (defun bar (x)
        (gum x))
    doesn't have to set it.
There are several techniques.  One is to tag the return value
count with the stack-frame that it's targeted for.  Functions
which pass through multiple values simply re-tag.  Calling
for multiple value clears the tag before call, in case some
earlier call left an identical tag.  If the caller doesn't
see its own stack level, it ignores the indicated count,
and knows that the called function returned exactly one value.

    I like multiple return values.  I find them elegant and pleasant to
    use.  In systems I've built we have used them with great satisfaction.
    It would be very sad to see them removed from Dylan, but I would be
    more likely to adopt Dylan if it didn't have multiple return values.
It would be sad if you didn't adopt Dylan because of an
erroneous assumption about the cost of a feature you
even like!