Fix $? to use %fits.

This commit is contained in:
C. Guy Yarvin 2018-03-17 18:06:15 -07:00
parent 28eac62fae
commit 79aa1cbc61
10 changed files with 155 additions and 174 deletions

View File

@ -466,8 +466,10 @@
::
++ dy-over :: finish construction
^+ +>
?: ?=({$show $3} -.mad)
(dy-rash %tan (dy-show-source q.mad) ~) :: XX separate command
:: XX needs filter
::
:: ?: ?=({$show $3} -.mad)
:: (dy-rash %tan (dy-show-source q.mad) ~) :: XX separate command
?: ?=($brev -.mad)
=. var (~(del by var) p.mad)
=< dy-amok
@ -546,6 +548,7 @@
$0 ~
$1 [[%rose [~ " " ~] (skol p.q.cay) ~] (mar)]
$2 [[%rose [~ " " ~] (dy-show-type-noun p.q.cay) ~] (mar)]
$3 ~
==
==
::
@ -1149,39 +1152,41 @@
{$hold *} a(p $(a p.a))
==
::
++ dy-shown
$? hoon
$^ {dy-shown dy-shown}
$% {$ur (unit knot) purl:eyre}
{$sa mark}
{$as mark dy-shown}
{$do hoon dy-shown}
{$ge path (list dy-shown) (map term (unit dy-shown))}
{$dv path}
==
==
:: XX needs filter
::
++ dy-show-source
|= a/dojo-source ^- tank
=- >[-]<
=+ `{@ bil/dojo-build}`a
|- ^- dy-shown
?- -.bil
$?($ur $dv $sa) bil
$ex ?. ?=({$cltr *} p.bil) p.bil
|- ^- hoon
?~ p.p.bil !!
?~ t.p.p.bil i.p.p.bil
[i.p.p.bil $(p.p.bil t.p.p.bil)]
$tu ?~ p.bil !!
|-
?~ t.p.bil ^$(bil q.i.p.bil)
[^$(bil q.i.p.bil) $(p.bil t.p.bil)]
$as bil(q $(bil q.q.bil))
$do bil(q $(bil q.q.bil))
$ge :+ %ge q.p.p.bil
[(turn p.q.p.bil ..$) (~(run by q.q.p.bil) (lift ..$))]
==
:: ++ dy-shown
:: $? hoon
:: $^ {dy-shown dy-shown}
:: $% {$ur (unit knot) purl:eyre}
:: {$sa mark}
:: {$as mark dy-shown}
:: {$do hoon dy-shown}
:: {$ge path (list dy-shown) (map term (unit dy-shown))}
:: {$dv path}
:: ==
:: ==
:: ::
:: ++ dy-show-source
:: |= a/dojo-source ^- tank
:: =- >[-]<
:: =+ `{@ bil/dojo-build}`a
:: |- ^- dy-shown
:: ?- -.bil
:: $?($ur $dv $sa) bil
:: $ex ?. ?=({$cltr *} p.bil) p.bil
:: |- ^- hoon
:: ?~ p.p.bil !!
:: ?~ t.p.p.bil i.p.p.bil
:: [i.p.p.bil $(p.p.bil t.p.p.bil)]
:: $tu ?~ p.bil !!
:: |-
:: ?~ t.p.bil ^$(bil q.i.p.bil)
:: [^$(bil q.i.p.bil) $(p.bil t.p.bil)]
:: $as bil(q $(bil q.q.bil))
:: $do bil(q $(bil q.q.bil))
:: $ge :+ %ge q.p.p.bil
:: [(turn p.q.p.bil ..$) (~(run by q.q.p.bil) (lift ..$))]
:: ==
::
++ dy-edit :: handle edit
|= cal/sole-change
@ -1679,26 +1684,10 @@
--
::
++ prep
=+ session-4==+($:session _-(lib *(list), sur *(list)))
=+ session-1==+($:session-4 _-(poy *(unit)))
=+ session-0==+($:session-1 _[_say syd=desk * _|2.-])
:: ,_`..prep
=+ ^= hoze
$% {$0 p/(map bone session-0)}
{$1 p/(map bone session-1)}
{$2 p/(map bone session-1)}
{$3 p/(map bone session-4)}
{$4 p/@ q/(map bone session-4)}
==
|= old/(unit ?(house hoze)) ^+ [~ ..prep]
|= old/(unit house)
^+ [~ ..prep]
?~ old `..prep
?+ -.u.old !!
$4 %= $
-.u.old %5
q.u.old (~(run by q.u.old) |:($:session-4 +<(sur ~, lib ~)))
==
$5 `..prep(+<+ u.old)
==
`..prep(+<+ u.old)
::
:: pattern: ++ foo |=(data he-abet:(~(he-foo he (~(got by hoc) ost)) data))
++ arm (arm-session ~ (~(got by hoc) ost.hid))

View File

@ -79,13 +79,13 @@
== ::
== ::
++ delta-story :> story delta
$? diff-story :< both in & outward
$% {$inherited ihr/?} :< inherited flag
{$follow sub/? srs/(set source)} :< un/subscribe
{$sequent cir/circle num/@ud} :< update last-heard
{$gram src/circle gam/telegram} :< new/changed msgs
{$sourced src/circle num/@ud} :< new heard-from
== == ::
diff-story :< both in & outward
== ::
:> # %out
:> outgoing data
+|

View File

@ -24,16 +24,16 @@
$dbug $(gen q.gen)
::
$xray
[[n.g.p.gen (turn a.g.p.gen shut-mart)] $(gen [%smts c.p.gen])]~
[[n.g.p.gen (turn a.g.p.gen shut-mart)] $(gen [%mcts c.p.gen])]~
::
$smts
$mcts
?~ p.gen ~
=- (weld - $(p.gen t.p.gen))
?^ -.i.p.gen $(gen [%xray i.p.gen])
~| [%shut-tuna -.i.p.gen]
?+ -.i.p.gen !!
$manx ?>(?=($xray -.p.i.p.gen) $(gen p.i.p.gen))
$marl ?>(?=($smts -.p.i.p.gen) $(gen p.i.p.gen))
$marl ?>(?=($mcts -.p.i.p.gen) $(gen p.i.p.gen))
==
==
::

View File

@ -103,9 +103,9 @@
{$remove $~} :< removed story
== ::
++ rumor-story :> story rumor
$? diff-story :< both in & outward
$% {$gram src/circle nev/envelope} :< new/changed message
== == ::
diff-story :< both in & outward
== ::
++ diff-config :> config change
$% {$full cof/config} :< set w/o side-effects
{$source add/? src/source} :< add/rem sources

View File

@ -1,6 +1,7 @@
:: ::
:::: /sys/hoon ::
:: ::
!:
=< ride
=> %143 =>
:: ::
@ -428,12 +429,6 @@
q/(list tank) ::
== ::
== ::
++ tanq :: tomorrow's tank
$~ [~ ~]
$? {~ p/(list tanq)} :: list of printables
{~ ~ p/tape} :: simple string
(pair @tas tanq) :: captioned
== ::
++ tape (list @tD) :: UTF8 string as list
++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
++ term @tas :: ascii symbol
@ -6976,32 +6971,58 @@
:: if no other choices, construct head
::
?~ rep relative:clear(mod one)
:: fin: loop completion
::
=/ fin/hoon $(one i.rep, rep t.rep)
:: new: trial product
:: old: original subject
::
=/ new [%$ 2]
=* old [%$ 3]
:: build trial noun
::
:+ %tsls
:: build the fragment with the first option
::
relative:clear(mod one)
:: build test
::
:^ %wtcl
:: if the trial noun equals the fragment
:: if we fit the type of this choice
::
[%dtts new fetch(axe (peg 3 axe))]
:: produce the trial noun
[%fits example:clear(mod one) fetch-wing]
:: build with this choice
::
new
:: continue with the original subject
relative:clear(mod one)
:: continue through loop
::
[%tsgr old fin]
$(one i.rep, rep t.rep)
::
:: ++ choice
:: :: match full models, by trying them
:: ::
:: |= $: :: one: first option
:: :: rep: other options
:: ::
:: one/plan
:: rep/(list plan)
:: ==
:: ^- hoon
:: :: if no other choices, construct head
:: ::
:: ?~ rep relative:clear(mod one)
:: :: fin: loop completion
:: ::
:: =/ fin/hoon $(one i.rep, rep t.rep)
:: :: new: trial product
:: :: old: original subject
:: ::
:: =/ new [%$ 2]
:: =* old [%$ 3]
:: :: build trial noun
:: ::
:: :+ %tsls
:: :: build the fragment with the first option
:: ::
:: relative:clear(mod one)
:: :: build test
:: ::
:: :^ %wtcl
:: :: if the trial noun equals the fragment
:: ::
:: [%dtts new fetch(axe (peg 3 axe))]
:: :: produce the trial noun
:: ::
:: new
:: :: continue with the original subject
:: ::
:: [%tsgr old fin]
::
++ switch
|= $: :: one: first format
@ -8807,7 +8828,7 @@
[%3 %0 axe]
(flan $(sut p.sut, axe (peg axe 2)) $(sut q.sut, axe (peg axe 3)))
::
{$core *} [%0 0]
{$core *} ~>(%mean.[%leaf "fish-core"] !!)
{$face *} $(sut q.sut)
{$fork *} =+ yed=~(tap in p.sut)
|- ^- nock
@ -8815,7 +8836,7 @@
{$help *} $(sut q.sut)
{$hold *}
?: (~(has in vot) sut)
[%0 0]
~>(%mean.[%leaf "fish-loop"] !!)
=> %=(. vot (~(put in vot) sut))
$(sut repo)
==
@ -11457,7 +11478,10 @@
::
++ word :: tarp parser
%+ knee *(list graf) |. ~+
%+ cook |=(a/?(graf (list graf)) ?+(a a {@ *} [a]~))
%+ cook
|= a/$%(graf [%list (list graf)])
^- (list graf)
?:(?=(%list -.a) +.a [a ~])
;~ pose
::
:: ordinary word
@ -11503,6 +11527,7 @@
::
:: #hoon
::
%+ stag %list
;~ plug
(stag %text ;~(pose (cold " " whit) (easy-sol ~)))
(stag %code ;~(pfix hax (echo wide)))
@ -11511,6 +11536,7 @@
::
:: direct hoon constant
::
%+ stag %list
;~ plug
(stag %text ;~(pose (cold " " whit) (easy-sol ~)))
::

View File

@ -342,7 +342,7 @@
== == == ::
++ riot (unit rant) :: response+complete
++ sign :: in result $<-
$? $: $a :: by %ames
$% $: $a :: by %ames
$% {$woot p/ship q/coop} ::
{$send p/lane:ames q/@} :: transmit packet
== == ::

View File

@ -1,19 +1,13 @@
::
:: dill (4d), terminal handling
::
!:
|= pit/vase
=, dill
=> |% :: interface tiles
++ gill (pair ship term) :: general contact
-- ::
=> |% :: console protocol
++ all-axle ?(old-axle axle) ::
++ old-axle :: all dill state
$: $2 ::
ore/(unit ship) :: identity once set
hey/(unit duct) :: default duct
dug/(map duct axon) :: conversations
== ::
++ axle ::
$: $3 ::
ore/(unit ship) :: identity once set
@ -43,11 +37,16 @@
++ move {p/duct q/(wind note gift:able)} :: local move
++ note-ames :: weird ames move
$% {$make p/(unit @t) q/@ud r/@ s/?} ::
{$sith p/@p q/@uw r/?} ::
{$sith p/@p q/@uw r/?} ::
{$wegh $~} ::
== ::
++ note-behn ::
$% {$wegh $~} ::
== ::
++ note-clay ::
$% {$merg p/@p q/@tas r/@p s/@tas t/case u/germ:clay}:: merge desks
{$warp p/sock q/riff:clay} :: wait for clay hack
{$warp p/sock q/riff:clay} :: wait for clay hack
{$wegh $~} ::
== ::
++ note-dill :: note to self, odd
$% {$crud p/@tas q/(list tank)} ::
@ -59,41 +58,64 @@
{$velo p/@t q/@t} :: reboot by path
{$verb $~} :: verbose mode
== ::
++ note-eyre ::
$% {$wegh $~} ::
== ::
++ note-ford ::
$% {$wegh $~} ::
== ::
++ note-gall ::
$% {$conf dock $load ship desk} ::
{$deal p/sock q/cush:gall} ::
{$deal p/sock q/cush:gall} ::
{$wegh $~} ::
== ::
++ note :: out request $->
$? {?($a $b $c $e $f $g) $wegh $~} ::
$% {$a note-ames} ::
{$b note-behn} ::
{$c note-clay} ::
{$d note-dill} ::
{$e note-eyre} ::
{$f note-ford} ::
{$g note-gall} ::
== == ::
== ::
++ sign-ames ::
$% {$nice $~} ::
{$send p/lane:ames q/@} ::
{$init p/ship} ::
{$mass p/mass} ::
== ::
++ sign-behn ::
$% {$mass p/mass} ::
== ::
++ sign-clay ::
$% {$mere p/(each (set path) (pair term tang))} ::
{$note p/@tD q/tank} ::
{$writ p/riot:clay} ::
{$mass p/mass} ::
== ::
++ sign-dill ::
$% {$blit p/(list blit)} ::
== ::
++ sign-eyre ::
$% {$mass p/mass} ::
== ::
++ sign-ford ::
$% {$mass p/mass} ::
== ::
++ sign-gall ::
$% {$onto p/(each suss:gall tang)} ::
{$unto p/cuft:gall} ::
{$mass p/mass} ::
== ::
++ sign :: in result $<-
$? {?($a $b $c $e $f $g) $mass p/mass} ::
$% {$a sign-ames} ::
{$b sign-behn} ::
{$c sign-clay} ::
{$d sign-dill} ::
{$e sign-eyre} ::
{$f sign-ford} ::
{$g sign-gall} ::
== == ::
==
:::::::: :: dill tiles
--
=| all/axle
@ -502,12 +524,8 @@
~
::
++ load :: trivial
|= old/all-axle
?: ?=($2 -.old)
$(old [%3 ore hey dug ~ ~ ~ ~ ~ ~]:old)
|= old/axle
..^$(all old)
:: |= old=* :: diable
:: ..^$(ore.all `~zod)
::
++ scry
|= {fur/(unit (set monk)) ren/@tas why/shop syd/desk lot/coin tyl/path}

View File

@ -35,7 +35,7 @@
$% {$deal p/sock q/cush:gall} :: full transmission
== == == ::
++ sign :: in result $<-
$? $: $a :: by %ames
$% $: $a :: by %ames
$% {$woot p/ship q/coop} :: acknowledgment
{$went ship cape:ames} :: XX ignore
== == ::
@ -2032,16 +2032,8 @@
~
::
++ load :: take previous state
=+ driv-5=_=>(*driv [cor=p req=req.q])
=+ bolo-5={$5 _=+($:bolo +.-(sec (~(run by sec.-) driv-5)))}
=+ bolo-4={$4 _%*(+ $:bolo-5 lyv *(map duct ^))}
::|= * %. (bolo +<)
|: $:{old/?(bolo bolo-5 bolo-4)} ^+ ..^$
?- -.old
$6 ..^$(+>- old)
$5 $(old [%6 +.old(sec (~(run by sec.old) |=(driv-5 [cor & req])))])
$4 $(old [%5 +.old(lyv ~)]) :: minor leak
==
|= old/bolo
..^$(+>- old)
::
++ scry
|= {fur/(unit (set monk)) ren/@tas why/shop syd/desk lot/coin tyl/path}

View File

@ -31,25 +31,6 @@
-- ::
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: %gall state
::::::::::::::::::::::::::::::::::::::::::::::::::::::
++ axle-n ?(axle-1 axle-2 axle-3 axle-4) :: upgrade path
++ axle-1 {$1 pol/(map ship mast-1)} ::
++ mast-1 ::
(cork mast-2 |:($:mast-2 +<(bum (~(run by bum) seat-1)))) ::
++ seat-1 ::
(cork seat-2 |:($:seat-2 +<+)) ::
++ axle-2 {$2 pol/(map ship mast-2)} ::
++ mast-2 (cork mast-3 |:($:mast-3 +<+)) ::
++ seat-2 seat-3 ::
++ axle-3 {$3 pol/(map ship mast-3)} ::
++ mast-3 ::
(cork mast-4 |:($:mast-4 +<(bum (~(run by bum) seat-3)))) ::
++ seat-3 ::
(cork seat-4 |:($:seat-4 +<+)) ::
++ axle-4 axle ::
++ mast-4 mast ::
++ seat-4 seat ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::: state proper
::::::::::::::::::::::::::::::::::::::::::::::::::::::
++ axle :: all state
$: $4 :: state version
pol/(map ship mast) :: apps by ship
@ -1304,33 +1285,8 @@
~
::
++ load :: recreate vane
|= old/axle-n
^+ ..^$
?- -.old
$4 ..^$(all old)
$3
%= $
old ^- axle-4
=> |=(seat-3 `seat-4`[*misvale-data +<])
=> |=(mast-3 +<(bum (~(run by bum) +>)))
old(- %4, pol (~(run by pol.old) .))
==
::
$2
%= $
old ^- axle-3
=> |=(mast-2 [*(unit duct) +<])
old(- %3, pol (~(run by pol.old) .))
==
::
$1
%= $
old ^- axle-2
=> |=(seat-1 `seat-2`[*worm +<])
=> |=(mast-1 +<(bum (~(run by bum) +>)))
old(- %2, pol (~(run by pol.old) .))
==
==
|= old/axle
..^$(all old)
::
++ scry
|= {fur/(unit (set monk)) ren/@tas why/shop syd/desk lot/coin tyl/path}

View File

@ -75,7 +75,7 @@
++ able ^?
|%
++ note :: out request $->
$? $: $d :: to %dill
$% $: $d :: to %dill
$% {$flog p/flog:dill} ::
== == ::
$: $a :: to %ames
@ -97,7 +97,7 @@
{$woot p/ship q/coop} :: reaction message
== ::
++ sign :: in result _<-
$? $: $g :: from %gall
$% $: $g :: from %gall
$% {$unto p/cuft:gall} ::
{$mean p/ares} :: XX old clean up
{$nice $~} ::
@ -649,7 +649,7 @@
bem/beam :: original path
== ::
+= gram :: inter-ship message
$? [[%lon ~] p=hole] :: login request
$% [[%lon ~] p=hole] :: login request
[[%aut ~] p=hole] :: login reply
[[%hat ~] p=hole q=hart] :: login redirect
[[%get ~] p=@uvH q=[? clip httq]] :: remote request
@ -945,7 +945,7 @@
pub/will :: their public keys
== ::
++ gift :: out result <-$
$? {$veil p/channel} :: secure channel
$% {$veil p/channel} :: secure channel
{$vest p/tally} :: balance update
{$vein p/life q/(map life ring)} :: private keys
{$vine p/(list change)} :: all raw changes
@ -4640,7 +4640,7 @@
::
++ zuse %309 :: hoon+zuse kelvin
++ gift-arvo :: out result <-$
$? gift:able:ames
$% gift:able:ames
gift:able:behn
gift:able:clay
gift:able:dill
@ -4649,7 +4649,7 @@
gift:able:gall
==
++ task-arvo :: in request ->$
$? task:able:ames
$% task:able:ames
task:able:clay
task:able:behn
task:able:dill
@ -4658,7 +4658,6 @@
task:able:gall
==
++ note-arvo :: out request $->
$? {@tas $meta vase}
$% {$a task:able:ames}
{$b task:able:behn}
{$c task:able:clay}
@ -4666,7 +4665,8 @@
{$e task:able:eyre}
{$f task:able:ford}
{$g task:able:gall}
== ==
{@tas $meta vase}
==
++ sign-arvo :: in result $<-
$% {$a gift:able:ames}
{$b gift:able:behn}