New ++ax seems almost working.
^- hoon
:+ %tsls
[%bust %noun]
- ~(construct sample [2 %|])
+ ~(construct sample(dom (peg 3 dom)) [2 %&])
::
++ basic
|= bas/base
$cell
:: reduce to pair of nouns
::
- =+($(mod [%axil %noun]) [- -])
+ =+($(bas %noun) [- -])
::
$bean
:: comparison produces boolean type
==
::
++ decorate
- :: document
+ :: apply documentation to expression
::
|= gen/hoon
^- hoon
:: interrogate this instance
::
:^ %wtcl
- :: test if we match this wing
+ :: test if the head matches this wing
::
- [%wtts p.i.rep fetch-wing]
- :: use this format
+ [%wtts p.one fetch-wing(axe (peg axe 2))]
+ :: if so, use this form
::
- :- `hoon`p.i.rep
- construct(mod q.i.rep, top &, axe (peg axe 3))
+ :- [%rock p.p.one q.p.one]
+ construct(mod q.one, top &, axe (peg axe 3))
:: continue in the loop
::
fin
:: guarded trap
::
:+ %tsgr
- :: constructor trap
- ::
- :+ %brdt ~^~
:: construct within trap
::
- %= construct
- :: old context within trap context
- ::
- dom (peg 3 dom)
- :: only kick trap if sample is known cell
+ :+ %brdt ~^~
+ :: trap is only kicked if sample is cell
::
- top [& &]
- ==
+ construct(top [& &])
:: boc: call constructor
:: but: default, but coerce type to call
::
