In Synopsis 5 (version 22),

Under "Variable (non-)interpolation" it's said that
<quote>
An interpolated hash matches the longest possible key of the hash as a
literal, or fails if no key matches. (A "" key will match anywhere,
provided no longer key matches.)
</quote>

And under "Extensible metasyntax (<...>)" it's said that
<quote>
With both bare hash and hash in angles, the key is counted as
"matched" immediately; that is, the current match position is set to
after the key token before calling any subrule in the value. That
subrule may, however, magically access the key anyway as if the
subrule had started before the key and matched with <KEY> assertion.
That is, $<KEY> will contain the keyword or token that this subrule
was looked up under, and that value will be returned by the current
match object even if you do nothing special with it within the match.
</quote>

I don't quite understand how these relate to each other. First text is
clear enough, but second seems to be something totally different.

Could someone give an example of what difference there's between
"interpolated hash matches the longest possible key of the hash as a
literal, or fails if no key matches." and "the key is counted as
"matched" immediately; that is, the current match position is set to
after the key token before calling any subrule in the value. ..."

I don't quite understand if the key is matched in the second version
or if it's just counted as "matched", whatever that means, and why the
description is so dis-similar to the first quote.

--
Markus Laire

Reply via email to