<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><base></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Most contexts expect one value, and you can easily define a macro that does the</div><div>(define-syntaxes ()</div><div> (begin0 (values) expr …))</div><div>or</div><div>(define-syntaxes ()</div><div> (begin expr … (values)))</div><div>for you. </div><div><br></div><div>The one that comes too my mind first is</div><div>(and (test-something-about x) (do-something-with x) (do-something-else-with x)),</div><div>where (do-something-with x) just returns void (which is a truthy value), but only if the test is true. </div><br><div><div>On Nov 23, 2014, at 9:17 PM, Roman Klochkov <<a href="mailto:kalimehtar@mail.ru">kalimehtar@mail.ru</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I can't imagine an example, where one need to use void function in context, that expects a single value.<br>Moreover, in macro definition I had to write<br><br><p>(define-syntaxes ()<br> (begin0 (values)<span class="Apple-converted-space"> </span><br> (save-fields! #'NAME (list 'ALL-FIELD ...))<br><br>to make side effect work in expansion time. I cannot write simply (save-fields! #'NAME (list 'ALL-FIELD ...), because save-fields! is at phase-1.<br>I prefer to write simply </p>(define-syntaxes () (save-fields! #'NAME (list 'ALL-FIELD ...))<br><br>but then save-fields! should return no values, not one void value.<br><br>Can you bring an example, where one have to to use void function in a context that expects a single value?<br><br><br>Sun, 23 Nov 2014 18:21:47 -0500 от "Alexander D. Knauth" <<a href="mailto:alexander@knauth.org">alexander@knauth.org</a>>:<br><blockquote style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(8, 87, 166); margin: 10px; padding: 0px 0px 0px 10px;"><div id=""><div class="js-helper js-readmsg-msg"><base target="_self" href="https://e.mail.ru/"><div id="style_14167849130000000480_BODY"><br><div><div>On Nov 23, 2014, at 1:31 PM, Roman Klochkov <<a href="x-msg://e.mail.ru/compose/?mailto=mailto%3akalimehtar@mail.ru" target="_blank">kalimehtar@mail.ru</a>> wrote:</div><br><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">> void is a good placeholder in dummy functions/objects<br><br>(define (foo) (values)) also works just fine.<br></div></blockquote><div><br></div><div>But then you can’t use (foo) in a context that expects a single value, but if you use (void) instead of (values), it will return one value (instead of zero values), and so you can use it in contexts that expect one value. </div><br><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>> fill a gap, which is useful<br><br>If function returns void?, then it is used as a procedure. I mean returned value never assigned to a variable.<br>So in what cases it is useful?<br><br><br>Sun, 23 Nov 2014 13:20:26 +0000 от Stephen De Gabrielle <<a href="x-msg://e.mail.ru/compose/?mailto=mailto%3aspdegabrielle@gmail.com" target="_blank">spdegabrielle@gmail.com</a>>:<br><blockquote style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(8, 87, 166); margin: 10px; padding: 0px 0px 0px 10px;">void is a good placeholder in dummy functions/objects. It doesn't do anything, except for fill a gap, which is useful.<br><br>Values is used to pass multiple values.<span> </span><br><br>Check the manual for details.<br><br>Does that help?<br><br>Stephen<br><br><div>On Sun, 23 Nov 2014 at 12:56 Roman Klochkov <<a target="_blank"></a><a href="mailto:kalimehtar@mail.ru">kalimehtar@mail.ru</a>> wrote:<br><blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div>When I should use (void) and when (values)?<br><br>They are both used to show, that there are no return values.<br>They are both not printable.<br><br>What is intended use for (void) and (values) and when one should prefer one over other?<br><br>--<span> </span><br>Roman Klochkov</div>____________________<br> Racket Users list:<br> <span> </span><a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br></blockquote></div></blockquote><br><br>--<span> </span><br>Roman Klochkov<br>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a></div></blockquote></div><br></div><base target="_self" href="https://e.mail.ru/"></div></div></blockquote><br><br>--<span class="Apple-converted-space"> </span><br>Roman Klochkov</div></blockquote></div><br></body></html>