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

re: define and set! with multiple-values



> Scott_Fahlman writes...
> Can you give some examples showing how these new forms would improve the
> expressiveness or clarity of a program?  Or are you just proposing these
> for the sake of symmetry?  That's a slippery slope...

Hear Hear!

> I rather like the current scheme in which the curse of multiple values is
> confined to a single form, BIND.  In fact, I'd like to find some way to
> eliminate Common-Lisp-like multiple values from DYLAN altogether.  There
> must be some better way to pass back possibly useful but rarely used extra
> information from a function to its caller.

As a programmer I like and enjoy multiple return values, it would be
sad to see them go.  The one time I listen in on the implementation of
multiple return values in Lisp they added an amazing amount of
confusion to the design meetings about function calling.  The time
spent on that complexity would have bought lots of cool valuable
things.

It would be interesting research to find out what the complexity/pain
for programmer and implementer of stricter rules placing stricter
rules on return value count.

The current design is, to my mind, just right.  We know a lot about how
to implement this kind of design. We know that it is pleasant to
program in this design.  We don't know enought about stricter designs
other than that they seem (or are) unpleasant.

I hope we know how to implement the current design so that:
    Usage                                     Cost
 - Binds of single values                      None
 - Binds of multiple values.                   Slight
 - Calls where it is lexically apparent that
   - zero return values are needed             None
   - one return value is needed                None
   - Unknown return values are needed          None
 - Functions that return
   - one value                                 ~none
   - N values                                  N * ~none
More columns are needed for the sealed cases.

The C programmer, having been denied the pleasures of multiple return
values, will assume they are new, suspect and probably evil.  Making
the cost claim like the one above will go part way toward calming his
fears.

- ben hyde