[racket] Multiple return values

From: Markku Rontu (markku.rontu at iki.fi)
Date: Fri Dec 16 07:45:51 EST 2011

On Fri, Dec 16, 2011 at 2:22 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:

> Zayr Okale wrote at 12/16/2011 06:52 AM:
>
>  In the simplest cases in CL I can ignore extra values for free (without
>> extra wrappers or any other code clutter). In Racket I cannot, and this is
>> what prompted my question: why not do it the CL way?
>>
>
> An ignored value of a multiple-value return could be a bug, rather than
> the intention of the programmer.  How can the compiler tell the difference?
>  How can someone reading the code later.
>
> I am glad that Racket considers an ignored multiple-value return value to
> be a bug.
>

A different question is whether an ignored single-value return value should
> be considered a bug.  Currently it is not, and a lot of code has been
> written assuming that it is not.
>
>
Hmm, I don't get the logic. Ignored single return value is not a bug and is
ok (because that's how things happened to be in that case in the first
place) but ignored multiple-value is a bug (because that's how things
happened to be in that case in the first place)? Ignored optional parameter
could be bug but nobody is complaining for Racket not complaining about it?
Of course there is no such thing as optional multiple-value return value
... as there is no named return value.

I would be happy if Racket by default would not consider these as bugs or
not bugs, especially only because that's how things used to be, or how much
legacy stuff there may be. Isn't that the purpose of PLT Scheme -> Racket
transition that things can and will be improved? And Racket has contracts,
tests and types, if someone wants to force or double-check something. Make
it a platform where you can define your local ideals of style and enforce
them automatically.

In fact I would be really glad also if someone came up with a neat syntax
to support symmetric input-output with optionality and nameability :)

-Markku



> --
> http://www.neilvandyke.org/
>
> ______________________________**___________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/**listinfo/users<http://lists.racket-lang.org/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111216/b6387eba/attachment.html>

Posted on the users mailing list.