<HTML><BODY>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) <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" <alexander@knauth.org>:<br>
<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        <div id="">
        



    









        
        


        
        
        

        

        
        

        
        

        
        



<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
        <div>
                <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="//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="//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;"><div><div><div>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">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></div></div></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>


</div>
</blockquote>
<br>
<br>-- <br>Roman Klochkov<br></BODY></HTML>