About to activate annotation.

This commit is contained in:
C. Guy Yarvin 2018-04-23 23:07:37 -07:00
parent 4d0ca3d6f2
commit 0c5050b542
2 changed files with 33 additions and 31 deletions

View File

@ -126,9 +126,7 @@
::
:: +meta: try to make spec from type of filter
::
++ meta
^- [(unit spec) _load]
::++ meta ^- [(unit spec) _load]
::
:: +main: make spec from any type
::
@ -142,9 +140,9 @@
[%cell *] (cell p.sut q.sut)
[%core *] (core p.sut q.sut)
[%face *] (face p.sut q.sut)
[%form *] =- ?~(- $(sut q.sut) [`-> load])
[%form *] =- ?~(- main(sut q.sut) [-> load])
?. ?=(%made -.q.p.sut) ~
(reform(sut p.p.sut) p.q.p.sut)
(reform p.p.sut p.q.p.sut)
[%fork *] (fork p.sut)
[%hold *] entry(sut ~(repo ut sut))
==
@ -153,27 +151,29 @@
::
++ reform
|= [=type =spec]
|- ^- (unit spec)
:: reform a spec left as a type annotation
::
?+ -.spec
%base spec
%dbug $(spec q.spec)
%leaf spec
%loop spec
%like :: hub: type of context
:: poy: reference
::
=/ hub %- ~(play ut sut)
|- ^- hoon
?~ q.spec [%$ 1]
[%tsgl [%wing i.q.spec] $(q.spec t.q.spec)]
=/ poy (~(fond ut hub) %free p.spec)
:: if, we have a simple arm, keep the spec
::
?.(?=([%& * * %| *] poy) ~ `spec)
%make
==
^- (unit ^spec)
`spec
:: |- ^- (unit spec)
:: :: reform a spec left as a type annotation
:: ::
:: ?+ -.spec
:: %base spec
:: %dbug $(spec q.spec)
:: %leaf spec
:: %loop spec
:: %like :: hub: type of context
:: :: poy: reference
:: ::
:: =/ hub %- ~(play ut sut)
:: |- ^- hoon
:: ?~ q.spec [%$ 1]
:: [%tsgl [%wing i.q.spec] $(q.spec t.q.spec)]
:: =/ poy (~(fond ut hub) %free p.spec)
:: :: if, we have a simple arm, keep the spec
:: ::
:: ?.(?=([%& * * %| *] poy) ~ `spec)
:: %make
:: ==
::
:: +atom: convert atomic type to spec
::

View File

@ -1,4 +1,4 @@
:: ::
:: ::
:::: /sys/hoon ::
:: ::
=< ride
@ -5787,7 +5787,7 @@
{$dbug p/spot q/hoon} :: debug info in trace
{$eror p/tape} :: assembly error
{$hand p/type q/nock} :: premade result
{$form p/note q/hoon} :: annotate
{$note p/note q/hoon} :: annotate
{$fits p/hoon q/wing} :: underlying ?=
{$knit p/(list woof)} :: assemble string
{$leaf p/(pair term @)} :: symbol
@ -7350,6 +7350,8 @@
::
|= gen/hoon
^- hoon
:: :+ %note [%made mod]
^- hoon
|- ^- hoon
?~(bug gen [%dbug i.bug $(bug t.bug)])
::
@ -9755,7 +9757,7 @@
{$tune *} [(face p.gen sut) [%0 %1]]
{$ktwt *} =+(vat=$(gen p.gen) [(wrap(sut p.vat) %lead) q.vat])
::
{$form *}
{$note *}
=+ hum=$(gen q.gen)
[(form [sut p.gen] p.hum) q.hum]
::
@ -9916,7 +9918,7 @@
{$ktwt *}
=+(vat=$(gen p.gen) [(wrap(sut p.vat) %lead) (wrap(sut q.vat) %lead)])
::
{$form *}
{$note *}
=+ vat=$(gen q.gen)
[(form [sut p.gen] p.vat) (form [dox p.gen] q.vat)]
::
@ -10253,7 +10255,7 @@
{$ktsg *} $(gen p.gen)
{$ktts *} (conk(sut $(gen q.gen)) p.gen)
{$ktwt *} (wrap(sut $(gen p.gen)) %lead)
{$form *} (form [sut p.gen] $(gen q.gen))
{$note *} (form [sut p.gen] $(gen q.gen))
{$sgzp *} ~_(duck(sut ^$(gen p.gen)) $(gen q.gen))
{$sggr *} $(gen q.gen)
{$tsgr *} $(gen q.gen, sut $(gen p.gen))