Yes, more or less. In an X-expression, an attribute list is the only element 
that's a list made of sublists. A list of embedded X-expressions, OTOH, will 
start with a symbol. To look at it another way,

> (cons symbol (list xexpr ...))

really amounts to

> (list symbol xexpr ...)


which is just

> (list symbol (list (list symbol string) ...) xexpr ...)


but without the attribute list, cf.

'(p "foo" "bar")

'(p ((style "default")) "foo" "bar")

A recurring annoyance in X-expressions is distinguishing these two cases on 
input, because the second element can be either an attribute list or nested 
X-expression. You can use `xexpr-drop-empty-attributes` to force an attribute 
list (even empty). My `txexpr` package also has utilities for handling them.


> 
> Here is the syntax for an xexp from xexp? in the reference:
> 
>   xexpr               =               string
>               |               (list symbol (list (list symbol string) ...) 
> xexpr ...)
>               |               (cons symbol (list xexpr ...))
>               |               symbol
>               |               valid-char?
>               |               cdata
>               |               misc
> 
> And in this latter syntax, how is the attribute list distinguished from a 
> list of embedded xexps? Is it due to the nesting in the attribute list?



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to