em icon indicating copy to clipboard operation
em copied to clipboard

Do not apply translocational attributes to own context

Open raineorshine opened this issue 4 years ago • 0 comments

Some metaprogramming attributes are used to apply attributes to a different part of the tree.

  • =focus/Zoom
  • =children
  • =grandchildren

e.g. =children/=style/color/red sets the color of all children of its context to red.

These so-called "translocative" attributes are unintentionally applied where they are defined due to the normal attribute logic, i.e. to the children of =children itself. I can imagine a few different approaches:

Initial ideas:

  • ~Treat all descendants of translocative attributes as raw text, not metaprogramming attributes.~
  • ~Require a special command to "quote" the descendant attributes.~

These prevent embedded expressions.

The descendants of a function should be lazy anyway and only apply when executed.

Currently the call sites look for =style or =children/=style, for example. Instead, they could be passed their styles after they have been parsed. Then the parser can pass the styles to the children, grandchildren, etc and not to the thought itself. ???

raineorshine avatar May 13 '20 04:05 raineorshine