Skip to content

Keyword with dot(s) #2106

Answered by allison-casey
Arkelis asked this question in Q&A
Jul 3, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

this is currently a limitation of the parser. @scauligi is currently doing a full rewrite of the parser that would give us proper support for compile time reader macros and could also potentially give us the flexibility to fix this as well and its already an open issue (see #2096). until then though, you will likely not be able to implement the keyword sugar for class/ids that hiccup provides unless you want to also allow/switch to strings as the tag name (i.e. ["div.my-class#my-id" ...] which is what i'd probably do) or stick with the explicit dict passing.

As an aside, using keywords as dictionary keys in Hy is generally discouraged since Hy is much more closely related to python than c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Arkelis
Comment options

Answer selected by Arkelis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants