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

RE: expressions vs. statements




> Guy Steele - Sun Microsystems Labs wrote:
> >
> >...
> >
> >                                                     If you want it to be
> >    the value of the block you should say so. ...
> >
> > (a) Why?
>
> Because it could be that it just happened to be the last line in the
> block. It's ambiguous whether it just ended up at the end or was
> deliberately put there to trigger a return value.

Yes.

In Curl, any value returned to the top-level of an applet will be displayed,
but this is not always what you want when create a block.  For this reason,
we have two kinds of blocks 'do', which does not produce a value, and
'value' which does.

- Christopher