Fully migrated to %hint.

This commit is contained in:
Curtis Yarvin 2018-04-24 23:07:21 -07:00
parent c8255dcf35
commit 2b4e003a75
3 changed files with 63 additions and 70 deletions

View File

@ -712,7 +712,7 @@
:: set of topics. Walk through it instead of showing it. :: set of topics. Walk through it instead of showing it.
:: (find-item-in-type t.topics q.sut) :: (find-item-in-type t.topics q.sut)
:: ::
{$form *} {$hint *}
$(sut q.sut) $(sut q.sut)
:: ::
{$hold *} $(sut (~(play ut p.sut) q.sut)) {$hold *} $(sut (~(play ut p.sut) q.sut))
@ -755,7 +755,7 @@
:: ?> ?=($docs -.p.sut) :: ?> ?=($docs -.p.sut)
:: `[%view [%header `+.p.sut (item-as-overview rest-type)]~] :: `[%view [%header `+.p.sut (item-as-overview rest-type)]~]
:: ::
{$form *} $(sut q.sut) {$hint *} $(sut q.sut)
{$hold *} $(sut (~(play ut p.sut) q.sut)) {$hold *} $(sut (~(play ut p.sut) q.sut))
$noun ~ $noun ~
$void ~ $void ~
@ -873,7 +873,7 @@
?+ sut ~ ?+ sut ~
{$core *} q.r.q.sut {$core *} q.r.q.sut
:: {$help *} ?>(?=($docs -.p.sut) `+.p.sut) :: {$help *} ?>(?=($docs -.p.sut) `+.p.sut)
{$form *} $(sut q.sut) {$hint *} $(sut q.sut)
{$hold *} $(sut (~(play ut p.sut) q.sut)) {$hold *} $(sut (~(play ut p.sut) q.sut))
== ==
:: ::
@ -1152,7 +1152,7 @@
{?($cube $face) ^} a(q $(a q.a)) {?($cube $face) ^} a(q $(a q.a))
{$cell ^} a(p $(a p.a), q $(a q.a)) {$cell ^} a(p $(a p.a), q $(a q.a))
{$fork *} a(p (silt (turn ~(tap in p.a) |=(b/type ^$(a b))))) {$fork *} a(p (silt (turn ~(tap in p.a) |=(b/type ^$(a b)))))
{$form *} !! {$hint *} !!
{$core ^} `wain`/core {$core ^} `wain`/core
{$hold *} a(p $(a p.a)) {$hold *} a(p $(a p.a))
== ==

View File

@ -140,40 +140,29 @@
[%cell *] (cell p.sut q.sut) [%cell *] (cell p.sut q.sut)
[%core *] (core p.sut q.sut) [%core *] (core p.sut q.sut)
[%face *] (face p.sut q.sut) [%face *] (face p.sut q.sut)
[%form *] =- ?~(- main(sut q.sut) [-> load]) [%hint *] =+((rely p.p.sut q.p.sut) ?^(- u.- main(sut q.sut)))
[%hint *] =- ?~(- main(sut q.sut) [-> load])
?. ?=(%made -.q.p.sut) ~ ?. ?=(%made -.q.p.sut) ~
(reform p.p.sut p.q.p.sut) (rehint p.p.sut p.q.p.sut)
[%fork *] (fork p.sut) [%fork *] (fork p.sut)
[%hold *] entry(sut ~(repo ut sut)) [%hold *] entry(sut ~(repo ut sut))
== ==
:: ::
:: +form: rationalize structure from type (stub) :: +rely: rationalize structure from type (stub)
:: ::
++ reform ++ rely
|= [=type =spec] |= [=type =note]
^- (unit ^spec) ^- (unit [spec _load])
`spec ?+ -.note ~
:: |- ^- (unit spec) $army `[%like [p.note ~]]
:: :: reform a spec left as a type annotation $navy =- `[[%make [%limb p.note] -<] ->]
:: :: |- ^- [(list spec) _load]
:: ?+ -.spec ?~ q.note [~ load]
:: %base spec =^ more load $(note t.q.note)
:: %dbug $(spec q.spec) =/ part (~(play ut type) [%tsgl [%limb %$] [%wing i.q.note])
:: %leaf spec =^ spec load entry(sut part)
:: %loop spec [[spec more] load]
:: %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 :: +atom: convert atomic type to spec
:: ::
@ -357,16 +346,16 @@
:: ::
:: %&: text tree :: %&: text tree
:: ::
%& :: trial: attempt at wide form %& :: trial: attempt at wide hint
:: ::
=/ trial ?~(wide.plum ~ [~ u=linear]) =/ trial ?~(wide.plum ~ [~ u=linear])
:: if wide form is available or optimal :: if wide hint is available or optimal
:: ::
?: ?& ?=(^ trial) ?: ?& ?=(^ trial)
?| ?=(~ tall.plum) ?| ?=(~ tall.plum)
(lte length.u.trial 40) (lte length.u.trial 40)
== == == ==
:: then produce wide form :: then produce wide hint
:: ::
[0 text.u.trial]~ [0 text.u.trial]~
:: else assert tall style (you gotta set either wide or tall) :: else assert tall style (you gotta set either wide or tall)

View File

@ -5924,9 +5924,9 @@
{$0 p/@} :: axis select {$0 p/@} :: axis select
== :: == ::
++ note :: type annotation ++ note :: type annotation
$% {$made p/spec} :: constructed by $% {$army p/term} :: constructed by
{$make p/spec} :: constructor for {$navy p/term q/(list wing)} :: constructor for
{$mark p/stud} :: declared standard {$cops p/stud} :: declared standard
== :: == ::
++ type $~ %noun :: ++ type $~ %noun ::
$@ $? $noun :: any nouns $@ $? $noun :: any nouns
@ -5937,7 +5937,7 @@
{$core p/type q/coil} :: object {$core p/type q/coil} :: object
{$face p/{p/what q/$@(term tune)} q/type} :: namespace {$face p/{p/what q/$@(term tune)} q/type} :: namespace
{$fork p/(set type)} :: union {$fork p/(set type)} :: union
{$form p/(pair type note) q/type} :: annotation {$hint p/(pair type note) q/type} :: annotation
{$hold p/type q/hoon} :: lazy evaluation {$hold p/type q/hoon} :: lazy evaluation
== :: == ::
++ tony :: ++tone done right ++ tony :: ++tone done right
@ -6478,13 +6478,13 @@
^- type ^- type
?:(=(%void pac) %void [%core pac con]) ?:(=(%void pac) %void [%core pac con])
:: ::
++ form ++ hint
~/ %form ~/ %hint
|= {p/(pair type note) q/type} |= {p/(pair type note) q/type}
^- type ^- type
?: =(%void q) %void ?: =(%void q) %void
?: =(%noun q) %noun ?: =(%noun q) %noun
[%form p q] [%hint p q]
:: ::
++ face :: make %face type ++ face :: make %face type
~/ %face ~/ %face
@ -7004,7 +7004,7 @@
[%cell *] (cell p.sut q.sut) [%cell *] (cell p.sut q.sut)
[%core *] (core p.sut q.sut) [%core *] (core p.sut q.sut)
[%face *] (face p.sut q.sut) [%face *] (face p.sut q.sut)
[%form *] !! :: (form(sut p.p.sut) q.p.sut) [%hint *] !!
[%fork *] (fork p.sut) [%fork *] (fork p.sut)
[%hold *] entry(sut ~(repo ut sut)) [%hold *] entry(sut ~(repo ut sut))
== ==
@ -7191,6 +7191,7 @@
hay=*wing hay=*wing
cox=*(map term spec) cox=*(map term spec)
bug=*(list spot) bug=*(list spot)
nut=*(unit note)
def=*(unit hoon) def=*(unit hoon)
== ==
|_ {fab/? mod/spec} |_ {fab/? mod/spec}
@ -7229,6 +7230,10 @@
$bcwt $(mod i.p.mod) $bcwt $(mod i.p.mod)
$bczp ~ $bczp ~
== ==
++ hint
|= not/note
^+ +>
?>(?=(~ nut) +>.$(nut `not))
:: ::
++ function ++ function
:: construct a function example :: construct a function example
@ -7294,7 +7299,7 @@
++ clear ++ clear
:: clear annotations :: clear annotations
^+ . ^+ .
.(bug ~, def ~) .(bug ~, def ~, nut ~)
:: ::
++ basal ++ basal
:: example base case :: example base case
@ -7350,8 +7355,7 @@
:: ::
|= gen/hoon |= gen/hoon
^- hoon ^- hoon
:: =- ?:(fab - [%note [%made mod] -]) =- ?~(nut - [%note u.nut -])
:: :+ %note [%made mod]
^- hoon ^- hoon
|- ^- hoon |- ^- hoon
?~(bug gen [%dbug i.bug $(bug t.bug)]) ?~(bug gen [%dbug i.bug $(bug t.bug)])
@ -8793,7 +8797,7 @@
$(sut p.sut) $(sut p.sut)
{$face *} $(sut repo) {$face *} $(sut repo)
{$fork *} [full/[~ ~ ~] ~] {$fork *} [full/[~ ~ ~] ~]
{$form *} $(sut repo) {$hint *} $(sut repo)
{$hold *} ?: (~(has in gil) sut) {$hold *} ?: (~(has in gil) sut)
[full/[~ ~ ~] ~] [full/[~ ~ ~] ~]
$(sut repo, gil (~(put in gil) sut)) $(sut repo, gil (~(put in gil) sut))
@ -8819,7 +8823,7 @@
== ==
[%face *] [%face p.sut burp(sut q.sut)] [%face *] [%face p.sut burp(sut q.sut)]
[%fork *] [%fork (~(run in p.sut) |=(type burp(sut +<)))] [%fork *] [%fork (~(run in p.sut) |=(type burp(sut +<)))]
[%form *] (form p.sut burp(sut q.sut)) [%hint *] (hint p.sut burp(sut q.sut))
[%hold *] [%hold burp(sut p.sut) q.sut] [%hold *] [%hold burp(sut p.sut) q.sut]
== ==
:: ::
@ -8882,7 +8886,7 @@
{$core *} ?:(?=(?({$atom *} {$cell *}) ref) sut sint) {$core *} ?:(?=(?({$atom *} {$cell *}) ref) sut sint)
{$face *} (face p.sut dext(sut q.sut)) {$face *} (face p.sut dext(sut q.sut))
{$fork *} (fork (turn ~(tap in p.sut) |=(type dext(sut +<)))) {$fork *} (fork (turn ~(tap in p.sut) |=(type dext(sut +<))))
{$form *} (form p.sut dext(sut q.sut)) {$hint *} (hint p.sut dext(sut q.sut))
{$hold *} ?< (~(has in bix) [sut ref]) {$hold *} ?< (~(has in bix) [sut ref])
dext(sut repo, bix (~(put in bix) [sut ref])) dext(sut repo, bix (~(put in bix) [sut ref]))
$noun dext(sut repo) $noun dext(sut repo)
@ -8898,7 +8902,7 @@
|- ^- type |- ^- type
?~ yed sut ?~ yed sut
$(yed t.yed, sut dext(ref i.yed)) $(yed t.yed, sut dext(ref i.yed))
{$form *} dext(ref repo(sut ref)) {$hint *} dext(ref repo(sut ref))
{$hold *} dext(ref repo(sut ref)) {$hold *} dext(ref repo(sut ref))
== ==
-- --
@ -9328,7 +9332,7 @@
?: con.pec $(sut p.sut, axe (peg axe 3)) ?: con.pec $(sut p.sut, axe (peg axe 3))
$(sut (peek(sut p.sut) way 2), axe (peg axe 6)) $(sut (peek(sut p.sut) way 2), axe (peg axe 6))
:: ::
{$form *} {$hint *}
$(sut repo) $(sut repo)
:: ::
{$face *} {$face *}
@ -9466,7 +9470,7 @@
{$fork *} =+ yed=~(tap in p.sut) {$fork *} =+ yed=~(tap in p.sut)
|- ^- nock |- ^- nock
?~(yed [%1 1] (flor ^$(sut i.yed) $(yed t.yed))) ?~(yed [%1 1] (flor ^$(sut i.yed) $(yed t.yed)))
{$form *} $(sut q.sut) {$hint *} $(sut q.sut)
{$hold *} {$hold *}
?: (~(has in vot) sut) ?: (~(has in vot) sut)
~>(%mean.[%leaf "fish-loop"] !!) ~>(%mean.[%leaf "fish-loop"] !!)
@ -9504,7 +9508,7 @@
{$core *} $(sut repo) {$core *} $(sut repo)
{$face *} (face p.sut $(sut q.sut)) {$face *} (face p.sut $(sut q.sut))
{$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<)))) {$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<))))
{$form *} (form p.sut $(sut q.sut)) {$hint *} (hint p.sut $(sut q.sut))
{$hold *} {$hold *}
?: (~(has in bix) [sut ref]) ?: (~(has in bix) [sut ref])
~>(%mean.[%leaf "fuse-loop"] !!) ~>(%mean.[%leaf "fuse-loop"] !!)
@ -9744,7 +9748,7 @@
:: ::
{$note *} {$note *}
=+ hum=$(gen q.gen) =+ hum=$(gen q.gen)
[(form [sut p.gen] p.hum) q.hum] [(hint [sut p.gen] p.hum) q.hum]
:: ::
{$sgzp *} ~_(duck(sut (play p.gen)) $(gen q.gen)) {$sgzp *} ~_(duck(sut (play p.gen)) $(gen q.gen))
{$sggr *} {$sggr *}
@ -9849,7 +9853,7 @@
{$core *} $(sut p.sut) {$core *} $(sut p.sut)
{$face *} $(sut q.sut) {$face *} $(sut q.sut)
{$fork *} (lien ~(tap in p.sut) |=(type ^$(sut +<))) {$fork *} (lien ~(tap in p.sut) |=(type ^$(sut +<)))
{$form *} $(sut q.sut) {$hint *} $(sut q.sut)
{$hold *} |((~(has in gil) sut) $(gil (~(put in gil) sut), sut repo)) {$hold *} |((~(has in gil) sut) $(gil (~(put in gil) sut), sut repo))
$noun | $noun |
$void & $void &
@ -9905,7 +9909,7 @@
:: ::
{$note *} {$note *}
=+ vat=$(gen q.gen) =+ vat=$(gen q.gen)
[(form [sut p.gen] p.vat) (form [dox p.gen] q.vat)] [(hint [sut p.gen] p.vat) (hint [dox p.gen] q.vat)]
:: ::
{$ktsg *} $(gen p.gen) {$ktsg *} $(gen p.gen)
{$sgzp *} ~_(duck(sut (play p.gen)) $(gen q.gen)) {$sgzp *} ~_(duck(sut (play p.gen)) $(gen q.gen))
@ -10033,7 +10037,7 @@
{$fork *} %+ levy ~(tap in p.sut) {$fork *} %+ levy ~(tap in p.sut)
|=(type dext(sut +<)) |=(type dext(sut +<))
{$face *} dext(sut q.sut) {$face *} dext(sut q.sut)
{$form *} dext(sut q.sut) {$hint *} dext(sut q.sut)
{$hold *} =+ (~(gas in *(set type)) `(list type)`[sut ref ~]) {$hold *} =+ (~(gas in *(set type)) `(list type)`[sut ref ~])
?: (~(has in gil) -) ?: (~(has in gil) -)
& &
@ -10133,7 +10137,7 @@
{$face *} dext(sut q.sut) {$face *} dext(sut q.sut)
{$fork *} ?. ?=(?({$atom *} $noun {$cell *} {$core *}) ref) sint {$fork *} ?. ?=(?({$atom *} $noun {$cell *} {$core *}) ref) sint
(lien ~(tap in p.sut) |=(type dext(tel |, sut +<))) (lien ~(tap in p.sut) |=(type dext(tel |, sut +<)))
{$form *} dext(sut q.sut) {$hint *} dext(sut q.sut)
{$hold *} ?: (~(has in seg) sut) | {$hold *} ?: (~(has in seg) sut) |
?: (~(has in gil) [sut ref]) & ?: (~(has in gil) [sut ref]) &
%= dext %= dext
@ -10153,7 +10157,7 @@
{$core *} dext(ref repo(sut ref)) {$core *} dext(ref repo(sut ref))
{$face *} dext(ref q.ref) {$face *} dext(ref q.ref)
{$fork *} (levy ~(tap in p.ref) |=(type sint(ref +<))) {$fork *} (levy ~(tap in p.ref) |=(type sint(ref +<)))
{$form *} dext(ref q.ref) {$hint *} dext(ref q.ref)
{$hold *} ?: (~(has in reg) ref) & {$hold *} ?: (~(has in reg) ref) &
?: (~(has in gil) [sut ref]) & ?: (~(has in gil) [sut ref]) &
%= dext %= dext
@ -10240,7 +10244,7 @@
{$ktsg *} $(gen p.gen) {$ktsg *} $(gen p.gen)
{$ktts *} (conk(sut $(gen q.gen)) p.gen) {$ktts *} (conk(sut $(gen q.gen)) p.gen)
{$ktwt *} (wrap(sut $(gen p.gen)) %lead) {$ktwt *} (wrap(sut $(gen p.gen)) %lead)
{$note *} (form [sut p.gen] $(gen q.gen)) {$note *} (hint [sut p.gen] $(gen q.gen))
{$sgzp *} ~_(duck(sut ^$(gen p.gen)) $(gen q.gen)) {$sgzp *} ~_(duck(sut ^$(gen p.gen)) $(gen q.gen))
{$sggr *} $(gen q.gen) {$sggr *} $(gen q.gen)
{$tsgr *} $(gen q.gen, sut $(gen p.gen)) {$tsgr *} $(gen q.gen, sut $(gen p.gen))
@ -10382,10 +10386,10 @@
:: ::
dext(hos [q.p.sut hos], sut q.sut) dext(hos [q.p.sut hos], sut q.sut)
:: ::
{$form *} {$hint *}
:: work through form :: work through hint
:: ::
(form p.sut dext(sut q.sut)) (hint p.sut dext(sut q.sut))
:: ::
{$fork *} {$fork *}
:: reconstruct each case in fork :: reconstruct each case in fork
@ -10445,7 +10449,7 @@
:: ~> %slog.[0 (dunk(sut =>(- ref)) 'sint: pro')] :: ~> %slog.[0 (dunk(sut =>(- ref)) 'sint: pro')]
:: - :: -
?+ ref . ?+ ref .
{$form *} $(ref q.ref) {$hint *} $(ref q.ref)
{$face *} {$face *}
:: extend all stacks in set :: extend all stacks in set
:: ::
@ -10486,7 +10490,7 @@
?- sut ?- sut
{$core *} [%cell %noun p.sut] {$core *} [%cell %noun p.sut]
{$face *} q.sut {$face *} q.sut
{$form *} q.sut {$hint *} q.sut
{$hold *} (rest [[p.sut q.sut] ~]) {$hold *} (rest [[p.sut q.sut] ~])
$noun (fork [%atom %$ ~] [%cell %noun %noun] ~) $noun (fork [%atom %$ ~] [%cell %noun %noun] ~)
* ~>(%mean.[%leaf "repo-fltt"] !!) * ~>(%mean.[%leaf "repo-fltt"] !!)
@ -10516,7 +10520,7 @@
|- ^- type |- ^- type
?+ sut ^$(vit t.vit) ?+ sut ^$(vit t.vit)
{$face *} (face p.sut ^$(vit t.vit, sut q.sut)) {$face *} (face p.sut ^$(vit t.vit, sut q.sut))
{$form *} (form p.sut ^$(sut q.sut)) {$hint *} (hint p.sut ^$(sut q.sut))
{$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<)))) {$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<))))
{$hold *} $(sut repo) {$hold *} $(sut repo)
== ==
@ -10537,7 +10541,7 @@
(core $(sut p.sut, u.i.vit lat) q.sut) (core $(sut p.sut, u.i.vit lat) q.sut)
{$face *} (face p.sut $(sut q.sut)) {$face *} (face p.sut $(sut q.sut))
{$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<)))) {$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<))))
{$form *} (form p.sut $(sut q.sut)) {$hint *} (hint p.sut $(sut q.sut))
{$hold *} ?: (~(has in vil) sut) {$hold *} ?: (~(has in vil) sut)
%void %void
$(sut repo, vil (~(put in vil) sut)) $(sut repo, vil (~(put in vil) sut))
@ -10578,7 +10582,7 @@
{$core *} ?>(|(=(%gold p.q.sut) =(%lead yoz)) sut(p.q yoz)) {$core *} ?>(|(=(%gold p.q.sut) =(%lead yoz)) sut(p.q yoz))
{$face *} (face p.sut $(sut q.sut)) {$face *} (face p.sut $(sut q.sut))
{$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<)))) {$fork *} (fork (turn ~(tap in p.sut) |=(type ^$(sut +<))))
{$form *} (form p.sut $(sut q.sut)) {$hint *} (hint p.sut $(sut q.sut))
{$hold *} $(sut repo) {$hold *} $(sut repo)
== ==
-- --
@ -10979,7 +10983,7 @@
[1 (add 'a' (mod (div gum 676) 26))] [1 (add 'a' (mod (div gum 676) 26))]
== ==
:: ::
{$form *} {$hint *}
$(sut q.sut) $(sut q.sut)
:: ::
{$face *} {$face *}
@ -11090,7 +11094,7 @@
^- ? ^- ?
?+ typ | ?+ typ |
{$hold *} $(typ ~(repo ut typ)) {$hold *} $(typ ~(repo ut typ))
{$form *} $(typ ~(repo ut typ)) {$hint *} $(typ ~(repo ut typ))
{$core *} {$core *}
|- ^- ? |- ^- ?
?~ q.s.q.typ | ?~ q.s.q.typ |