++find now produces a ++port.

This commit is contained in:
C. Guy Yarvin 2016-01-19 15:31:40 -08:00
parent ee6a49d930
commit 4af8543d2c

View File

@ -132,7 +132,8 @@
++ pole |* a/$+(* *) :: nameless list ++ pole |* a/$+(* *) :: nameless list
$@($~ {a (pole a)}) :: $@($~ {a (pole a)}) ::
++ port (each palo (pair span nock)) :: successful match ++ port (each palo (pair span nock)) :: successful match
++ pony %+ each :: new pull result ++ pony :: raw
%+ each :: new pull result
palo :: natural result palo :: natural result
%+ each :: abnormal %+ each :: abnormal
@ud :: unmatched / skips @ud :: unmatched / skips
@ -343,13 +344,12 @@
{$fork p/(set span)} :: union {$fork p/(set span)} :: union
{$hold p/span q/twig} :: lazy evaluation {$hold p/span q/twig} :: lazy evaluation
== :: == ::
++ tart (each (pair vein opal) (pair span nock)) :: true/false alias
++ tone $% {$0 p/*} :: success ++ tone $% {$0 p/*} :: success
{$1 p/(list)} :: blocks {$1 p/(list)} :: blocks
{$2 p/(list {@ta *})} :: error ~_s {$2 p/(list {@ta *})} :: error ~_s
== :: == ::
++ tool :: complex ++ tool :: complex
$: p/(map term (unit tart)) :: definitions $: p/(map term (unit port)) :: definitions
q/(list (pair span nock)) :: bridges q/(list (pair span nock)) :: bridges
== :: == ::
++ toon $% {$0 p/*} :: success ++ toon $% {$0 p/*} :: success
@ -7815,21 +7815,14 @@
:_ sut :_ sut
^- tool ^- tool
:_ ~ :_ ~
^- (map term (unit tart)) ^- (map term (unit port))
:_ [~ ~] :_ [~ ~]
:+ cog ~ :+ cog ~
^- tart ^- port
=+ hup=~(reek ap gen) =+ hup=~(reek ap gen)
?~ hup ?~ hup
`tart`[%| (mint %noun gen)] `port`[%| (mint %noun gen)]
=+ fid=(find %both u.hup) (find %both u.hup)
?- -.fid
$& `tart`[%& p.fid]
$| ?- -.p.fid
$& ~|([%find u.hup] !!)
$| `tart`[%| p.p.fid]
==
==
:: ::
++ conk ++ conk
|= got/toga |= got/toga
@ -8157,14 +8150,14 @@
:: ::
++ play ++ play
^- span ^- span
=+ lug=(seed hyp) =+ lug=(find %read hyp)
?: ?=($| -.lug) ~|(%twig ?>(?=($~ rig) p.p.lug)) ?: ?=($| -.lug) ~|(%twig ?>(?=($~ rig) p.p.lug))
(elbo p.lug rig) (elbo p.lug rig)
:: ::
++ mint ++ mint
|= gol/span |= gol/span
^- (pair span nock) ^- (pair span nock)
=+ lug=(seed hyp) =+ lug=(find %read hyp)
?: ?=($| -.lug) ~|(%twig ?>(?=($~ rig) p.lug)) ?: ?=($| -.lug) ~|(%twig ?>(?=($~ rig) p.lug))
=- ?>(?|(!vet (nest(sut gol) & p.-)) -) =- ?>(?|(!vet (nest(sut gol) & p.-)) -)
(etco p.lug rig) (etco p.lug rig)
@ -8173,7 +8166,7 @@
|= {gol/span dox/span} |= {gol/span dox/span}
^- {span span} ^- {span span}
~| %mull ~| %mull
=+ lug=[p=(seed hyp) q=(seed(sut dox) hyp)] =+ lug=[p=(find %read hyp) q=(find(sut dox) %read hyp)]
?: ?=($| -.p.lug) ?: ?=($| -.p.lug)
?> &(?=($| -.q.lug) ?=($~ rig)) ?> &(?=($| -.q.lug) ?=($~ rig))
[p.p.p.lug p.p.q.lug] [p.p.p.lug p.p.q.lug]
@ -8213,7 +8206,14 @@
:: ::
++ find ++ find
|= {way/vial hyp/wing} |= {way/vial hyp/wing}
~+ ^- port
~| [%find hyp]
=- ?- -<
$& [%& p.-]
$| ?- -.p.-
$| [%| p.p.-]
$& !!
== ==
|- ^- pony |- ^- pony
?~ hyp ?~ hyp
[%& ~ %& sut] [%& ~ %& sut]
@ -8291,7 +8291,7 @@
++ fear $(sut q.sut, lon [~ lon]) ++ fear $(sut q.sut, lon [~ lon])
++ main ++ main
^- pony ^- pony
=% tyr/(unit (unit tart)) (~(get by p.p.sut) u.q.heg) =% tyr/(unit (unit port)) (~(get by p.p.sut) u.q.heg)
?~ tyr ?~ tyr
next next
?~ u.tyr ?~ u.tyr
@ -8309,7 +8309,7 @@
=+ fid=^$(sut p.i.q.p.sut, lon ~, axe 1) =+ fid=^$(sut p.i.q.p.sut, lon ~, axe 1)
?: ?=({$| $& *} fid) ?: ?=({$| $& *} fid)
$(q.p.sut t.q.p.sut, p.heg p.p.fid) $(q.p.sut t.q.p.sut, p.heg p.p.fid)
=+ vat=(fine (ride fid)) =+ vat=(fine `port`?-(-.fid $& fid, $| [%| p.p.fid]))
[%| %| p.vat (comb q.vat (comb [%0 axe] q.i.q.p.sut))] [%| %| p.vat (comb q.vat (comb [%0 axe] q.i.q.p.sut))]
-- --
:: ::
@ -8563,10 +8563,14 @@
:- (nice bool) :- (nice bool)
=+ ref=(play ~(bunt al %herb p.gen)) =+ ref=(play ~(bunt al %herb p.gen))
=+ fid=(find %read q.gen) =+ fid=(find %read q.gen)
~| [%find q.gen] ~| [%test q.gen]
|- ^- nock
?- -.fid ?- -.fid
$& ?>(?=($& -.q.p.fid) (fish(sut ref) (tend p.p.fid))) $& ?- -.q.p.fid
$| ?>(?=($| -.p.fid) [%7 q.p.p.fid (fish(sut ref) 1)]) $& (fish(sut ref) (tend p.p.fid))
$| $(fid [%| (fine fid)])
==
$| [%7 q.p.fid (fish(sut ref) 1)]
== ==
:: ::
{$dbug *} {$dbug *}
@ -9001,21 +9005,6 @@
== ==
~ ~
:: ::
++ ride
|= fid/pony
^- port
?- -.fid
$& [%& p.fid]
$| ?- -.p.fid
$| [%| p.p.fid]
$& !!
== ==
::
++ seed
|= hyp/wing
^- port
~|([%find hyp] (ride (find %read hyp)))
::
++ take ++ take
|= {vit/vein duz/$+(span span)} |= {vit/vein duz/$+(span span)}
^- (pair axis span) ^- (pair axis span)