Closed drbeefsupreme closed 2 years ago
OK, maybe this shouldn't be documented since it sounds like it shouldn't exist based on comments in the other thread.
Yeah nevermind, I should have made the other issue first and realized this is deprecated syntax.
+*
is pretty cursed. I discovered today that it has two syntaxes. These are both valid:Right now, the docs say that you can only use
+*
in a door, and only at the beginning of the core, before the rest of the arms. This turns out not to be the case - there is a second syntax for+*
that works in doors as well as|%
and|@
. I couldn't find anywhere in the kernel where it is used, but it is found here: https://github.com/urbit/urbit/blob/master/pkg/base-dev/lib/language-server/complete.hoon#L6-L7The compact explanation for why this is happening: the first
+*
in|_
is parsed using+wasp
. It gets thrown into its own particular spot in the AST as thealas
in%brcb
, and the later modifications to the real arms are performed in+open:ap
. Any subsequent invocations of+*
in a|_
, or for|%
and|@
are parsed by+boog
, and unlike the first+*
in a door, these are "real arms".Unfortunately this second syntax doesn't seem to desugar nicely - it involves a
%made
spec
, which isn't produced any other way. It seems to mostly work like|$
though, with an additional annotation. When the%made
spec
travels through the compiler, it ends up as a%made
%note
which then ends up in a%hint
type. This doesn't happen with|$
. But these yield the same output: