<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;"><br><div><div>On Jul 27, 2014, at 1:20 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;"><p>It is bound to racket/base lambda. More correct, phase0 lambda in racket/base.<br>But when you call it in level 2, there are no level 0 lambda.<br><br>Minimal similar test-case:<br>---------------<br>(module m racket/base<br>  (provide test-stx)<br></p></div></blockquote>;; what you need here is this:</div><div>(require (for-template racket/base))</div><div><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;"><p>  (define (test-stx) #'(lambda (x) x)))</p><p>(require (for-syntax 'm))</p><p>(define-syntax (test stx) (test-stx))</p><p>test<br></p></div></blockquote><div><br></div><div>Then it works fine.  But since #λ is a reader extension, not a macro, it could be at any phase level.  </div><div>I was wondering if there’s any way to construct an identifier that would be bound to lambda from racket/base</div><div>no matter what phase level it’s referenced at.  </div><div>These examples with macros only have to make sure that it’s there at the for-template phase level relative to test-stx.  </div><div>A reader extension doesn’t have that constraint.  </div><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;"><p><br>. lambda: unbound identifier;<br> also, no #%app syntax transformer is bound in: lambda<br>----------------<br><br>Minimal correct case:<br>------------------<br>(module m racket/base<br>  (provide test-stx)<br>  (define (test-stx a l)<br>    (with-syntax ([#%app a]<br>                  [lambda l])<br>      #'(lambda (x) x))))</p><p>(require (for-syntax 'm))</p><p>(define-syntax (test stx) (test-stx #'#%app #'lambda))</p><p>test<br>--------------------<br><br>So you have to somehow give correct #'lambda and #'#%app into your macros.<br><br><br>Sun, 27 Jul 2014 12:21:36 -0400 от "Alexander D. Knauth" <<a href="mailto:alexander@knauth.org">alexander@knauth.org</a>>:<br></p><blockquote style="margin: 10px; padding: 0px 0px 0px 10px; border-left-color: rgb(8, 87, 166); border-left-width: 1px; border-left-style: solid;"><div class="js-helper js-readmsg-msg"><base href="https://e.mail.ru/" target="_self"><div id="style_14064781020000000785_BODY"><div>I just tried to try it and see if it worked, when I realized that it won’t work because I can’t use quote-syntax.  </div><div><br></div><div>Is there any way to get around that?  And would it even work anyway?  </div><br><div><div>On Jul 27, 2014, at 6:59 AM, 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-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -webkit-text-stroke-width: 0px;">Maybe via "<a name="(part._cross-phase._persistent-grammar)" class="mceItemAnchor"></a>Cross-Phase Persistent Module Declarations" <a href="http://docs.racket-lang.org/reference/syntax-model.html#%28part._cross-phase._persistent-grammar%29" target="_blank">http://docs.racket-lang.org/reference/syntax-model.html#%28part._cross-phase._persistent-grammar%29</a><span> </span>?<br><br><br>Thu, 24 Jul 2014 21:24:20 -0400 от "Alexander D. Knauth" <<a href="x-msg://e.mail.ru/compose/?mailto=mailto%3aalexander@knauth.org" target="_blank">alexander@knauth.org</a>>:<br><blockquote style="margin: 10px; padding: 0px 0px 0px 10px; border-left-color: rgb(8, 87, 166); border-left-width: 1px; border-left-style: solid;"><div>How can I make an identifier that will have a certain binding no matter what phase level it's referenced at?<div><br></div><div>For example if I’m making a reader extension that will produce a lambda expression, how do I make it so that the lambda expression will be able to exist at any phase level?</div><div><br></div><div>For example this program using #lang rackjure doesn’t work:</div><div><div><font face="Courier New">#lang rackjure</font></div><div><font face="Courier New">(require (for-meta 1 racket/base)</font></div><div><font face="Courier New">         (for-meta 2 racket/base)</font></div><div><font face="Courier New">         (for-meta 3 racket/base)</font></div><div><font face="Courier New">         (for-meta 4 racket/base)</font></div><div><font face="Courier New">         )</font></div><div><font face="Courier New">                                                                                             </font></div><div><font face="Courier New">#λ(* 2 %) ; works, produces approx. (lambda (%) (* 2 %))</font></div><div><font face="Courier New">(begin-for-syntax</font></div><div><font face="Courier New">  (begin-for-syntax</font></div><div><font face="Courier New">    #λ(* 2 %) ; lambda: unbound identifier at phase 2;</font></div><div><font face="Courier New">    ;         ;   also, no #%app syntax transformer is bound in: lambda</font></div><div><font face="Courier New">    ))</font></div></div><div><br></div><div>Is there any way to construct an identifier that would be bound to lambda from racket/base no matter what phase level it’s used in?</div><div><br></div><div><br></div></div><div>____________________<br>  Racket Users list:<br>  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br><br></div></blockquote><br><br>--<span> </span><br>Roman Klochkov</div></blockquote></div><br></div><base href="https://e.mail.ru/" target="_self"></div></blockquote><br><br>--<span class="Apple-converted-space"> </span><br>Roman Klochkov</div></blockquote></div><br></body></html>