6.0.1.6
9.7 Tag
(require pollen/tag) | package: pollen |
Convenience functions for working with tags.
procedure
(make-tag-function id) → (-> txexpr?)
id : txexpr-tag?
Make a tag function for id. As arguments, a tag function takes an optional set of X-expression attributes (txexpr-attrs?) followed by X-expression elements (txexpr-elements?). From these, the tag function creates a tagged X-expression using id as the tag.
Examples: | ||||||||||
|
Entering attributes this way can be cumbersome. So for convenience, a tag function provides an alternative: any symbol + string pairs at the front of your expression will be interpreted as attributes, if the symbols are followed by a colon. If you leave out the colon, the symbols will be interpreted as part of the content of the tag.
Examples: | ||||||||||||||
|
Pollen also uses this function to provide the default behavior for undefined tags. See #%top.