<div dir="ltr">Is #:auto-nested-attributes documented anywhere? I can't seem to find it in the syntax class documentation</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 3, 2015 at 3:28 PM, Alexander D. Knauth <span dir="ltr"><<a href="mailto:alexander@knauth.org" target="_blank">alexander@knauth.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you switch the order in which the syntax-classes are defined and add #:auto-nested-attribustes, this works:<br>
#lang racket<br>
(require syntax/parse)<br>
<span class="">(define-syntax-class B<br>
  (pattern (b1 b2 b3)))<br>
</span>(define-syntax-class A<br>
  #:auto-nested-attributes<br>
<span class="">  (pattern (a1 a2:B a3)))<br>
</span><span class="">(define foo<br>
  (syntax-parser<br>
    [blah:A #'blah.a2.b1]))<br>
</span>(syntax->datum (foo #'(1 (2 3 4) 5))) ; 2<br>
<br>
But for some reason this doesn’t work:<br>
#lang at-exp racket<br>
(require syntax/parse)<br>
(define-syntax-class A<br>
  #:auto-nested-attributes<br>
<span class="">  (pattern (a1 a2:B a3)))<br>
(define-syntax-class B<br>
  (pattern (b1 b2 b3)))<br>
</span><span class="">(define foo<br>
  (syntax-parser<br>
    [blah:A #'blah.a2.b1]))<br>
</span>(syntax->datum (foo #'(1 (2 3 4) 5))) ; 'blah.a2.b1<br>
<br>
But this does:<br>
#lang at-exp racket<br>
(require syntax/parse)<br>
(define-syntax-class A<br>
  #:attributes (a2.b1)<br>
<span class="">  (pattern (a1 a2:B a3)))<br>
(define-syntax-class B<br>
  (pattern (b1 b2 b3)))<br>
</span><span class="">(define foo<br>
  (syntax-parser<br>
    [blah:A #'blah.a2.b1]))<br>
</span>(syntax->datum (foo #'(1 (2 3 4) 5))) ; 2<br>
<div><div class="h5"><br>
On Feb 3, 2015, at 5:30 PM, Jack Firth <<a href="mailto:jackhfirth@gmail.com">jackhfirth@gmail.com</a>> wrote:<br>
<br>
> Suppose I have these syntax classes:<br>
><br>
> (define-syntax-class A<br>
>   (pattern (a1 a2:B a3)))<br>
><br>
> (define-syntax-class B<br>
>   (pattern (b1 b2 b3)))<br>
><br>
> I'd like to be able to access nested attributes, like so:<br>
><br>
> (define foo<br>
>   (syntax-parser<br>
>     [blah:A #'blah.a2.b1]))<br>
><br>
> Currently, this doesn't work (and it doesn't even throw an error either). How could I do this?<br>
</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>
</blockquote></div><br></div>