Raku / doc

🦋 Raku documentation
https://docs.raku.org/
Artistic License 2.0
287 stars 292 forks source link

Deciding whether (for example) `@^` is a twigil, or rather a sigil followed by a twigil... #3966

Open jubilatious1 opened 3 years ago

jubilatious1 commented 3 years ago

From @codesections #3965 :

"I also added a few more X<index> entries, which should help with the issue @jubilatious1 brought up – it doesn't resolve it, but at least if someone is thinking of @^ as a twigil (rather than a sigil followed by a twigil), they'll now get something in the search box."

Originally posted by @codesections in https://github.com/Raku/doc/pull/3965#issuecomment-925050297

codesections commented 3 years ago

See also the (brief) discussion of Twigils in the design docs https://design.raku.org/S02.html#Twigils

raiph commented 3 years ago

From the design doc:

Secondary sigils (twigils) have no influence over whether the primary sigil interpolates. That is, if $a interpolates, so do $^a, $*a, $=a, $?a, $.a, etc. It only depends on the $.

This demonstrates a very compelling reason to try to strongly establish the notion that a twigil is the secondary sigil, not the pair. They are orthogonal to (varying independently of) each other, and it'll presumably make doc significantly more confusing if it doesn't lean on that orthogonality.

So it makes sense to both allow that users might get confused and think that a twigil refers to the pairing, but to nevertheless try hard to avoid such confusion arising.