Named field access in custom element hooks #152
okomestudio
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
Ideally the change would be backward compatible such that user elements with and without argument would work. This can be achieved via |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I propose that the function hooks for custom elements accept an extra argument
ST
, so that it has access to named field values for the current template.The motivation for the change follows.
Currently, the function hook has the signature
for which the proposed change results in
so that named fields will be available as an alist via
(cdr st)
. This change appears necessary to access named fields, as writing a template likedoes not pass the value of
my-field
as theelt
argument tomy-elt
.On the other hand, if there is a better way to achieve named field access, the proposed change will not be necessary. In that case, I’d like to know what the available method is.
This may be classified as a breaking change, and if accepted, the README section on the topic will need an update. A proof-of-concept PR will follow.
Beta Was this translation helpful? Give feedback.
All reactions