5 ms·
From OP, in the section "Our first mold": After seeing a few span examples, are we ready to describe the set of all spans with a Hoon mold? Well, no, but let'
by urbit 11y ago
From OP, in the section "Our first mold":
After seeing a few span examples, are we ready to describe the set of all spans with a Hoon mold? Well, no, but let's try it anyway. Ignore the syntax (which we'll explain later; this is a tutorial, not a reference manual), and you'll get the idea:
++ span
$% [%atom p=@tas]
[%cell p=span q=span]
[%cube p=* q=span]
==
This mold is not the entire definition of a Hoon span, just the cases we've seen so far. In English, a valid span is either:
- a cell with head `%atom`, and tail some symbol.
- a cell with head `%cell`, and tail some pair of spans.
- a cell with head `%cube`, and tail a noun-span pair.
I do think this is clear enough. I'm not sure it's intuitive enough. The following chapters should help with that; sorry.
- evanpw 11y agoBut is this a representation of a mold or span? It seems to describe a set rather than define a function, so the latter seems more likely, but the section header implies otherwise.
- urbit 11y agoThat's pretty much what a mold is. The syntax is written to look as much as possible like the description of a set, but the semantics are that you're actually defining a function.