[racket] (values) vs (void)

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Sun Nov 23 13:31:16 EST 2014

 > void is a good placeholder in dummy functions/objects

(define (foo) (values)) also works just fine.

> fill a gap, which is useful

If function returns void?, then it is used as a procedure. I mean returned value never assigned to a variable.
So in what cases it is useful?


Sun, 23 Nov 2014 13:20:26 +0000 от Stephen De Gabrielle <spdegabrielle at gmail.com>:
>void is a good placeholder in dummy functions/objects. It doesn't do anything, except for fill a gap, which is useful.
>
>Values is used to pass multiple values. 
>
>Check the manual for details.
>
>Does that help?
>
>Stephen
>
>On Sun, 23 Nov 2014 at 12:56 Roman Klochkov < kalimehtar at mail.ru > wrote:
>>When I should use (void) and when (values)?
>>
>>They are both used to show, that there are no return values.
>>They are both not printable.
>>
>>What is intended use for (void) and (values) and when one should prefer one over other?
>>
>>-- 
>>Roman Klochkov ____________________
>>  Racket Users list:
>>   http://lists.racket-lang.org/ users


-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141123/50fecd9b/attachment.html>

Posted on the users mailing list.