arvo, ford: add type safety to scry

Adds a nest-check to the scry-wrapper functions +sloy and +sloy-light,
plugging a type hole in .^ namespace reads (scry).
This commit is contained in:
Joe Bryan 2019-08-28 15:39:04 -07:00 committed by Jared Tobin
parent 806871de4e
commit a6272a97a8
No known key found for this signature in database
GPG Key ID: 0E4647D58F8A69E4
3 changed files with 31 additions and 15 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3595404052bad183ac0be94bf46deec4a14c16c7ed4fd8aa6159eb24ad21a8cb
size 13839902
oid sha256:ccadeb320517eb506679198684eae00d0d37d28554de5c29f6de4a02b52b22ae
size 13599425

View File

@ -64,7 +64,7 @@
++ sley $- {* (unit (set monk)) term beam} :: namespace function
(unit (unit cage)) ::
++ slyd $- {* (unit (set monk)) term beam} :: super advanced
(unit (unit (cask))) ::
(unit (unit (cask milt))) ::
++ slyt $-({* *} (unit (unit))) :: old namespace
+$ vane [=vase =worm]
++ vile :: reflexive constants
@ -112,10 +112,18 @@
?~ dyc ~
?. ?=(^ ved) ~
=/ ron=@tas u.hyr
=+ bed=[[u.fal u.dyc (case p.u.ved)] (flop tyl)]
=+ bop=(sod ref ~ ron bed)
=/ bed=beam
[[u.fal u.dyc (case p.u.ved)] (flop tyl)]
=/ bop=(unit (unit (cask milt)))
(sod ref ~ ron bed)
?~ bop ~
?~ u.bop [~ ~]
:: XX figure out wth to do about hoon-version
::
?. ?& ?=([?(%151 %141) *] ref)
-:(~(nets wa *worm) +.ref -.q.u.u.bop)
==
~>(%slog.[0 leaf+"arvo: scry-lost"] ~)
[~ ~ +.q.u.u.bop]
:: +sloy-light: minimal parsing version of sloy
::
@ -135,10 +143,18 @@
|= [ref=* ron=@tas fal=@p dyc=@tas ved=case tyl=path]
:: we do not flop tyl because tyl wouldn't have been flopped by +en-beam
::
=+ bed=[[fal dyc ved] tyl]
=+ bop=(sod ref ~ ron bed)
=/ bed=beam
[[fal dyc ved] tyl]
=/ bop=(unit (unit (cask milt)))
(sod ref ~ ron bed)
?~ bop ~
?~ u.bop [~ ~]
:: XX figure out wth to do about hoon-version
::
?. ?& ?=([?(%151 %141) *] ref)
-:(~(nets wa *worm) +.ref -.q.u.u.bop)
==
~>(%slog.[0 leaf+"arvo: scry-dark"] ~)
[~ ~ +.q.u.u.bop]
::
++ symp :: symbol or empty
@ -350,7 +366,7 @@
ren/@t
bed/beam
==
^- (unit (unit (cask)))
^- (unit (unit (cask milt)))
:: ~& [%arvo-scry ren bed]
=/ old=scry-sample
:* fur
@ -360,10 +376,10 @@
`coin`[%$ r.bed]
(flop s.bed)
==
^- (unit (unit (cask)))
^- (unit (unit (cask milt)))
=+ fun=-:(~(slap wa worm.vane) rig [%limb %scry])
::
%- (unit (unit (cask)))
%- (unit (unit (cask milt)))
(slum q.fun old)
::
++ soar :: scrub vane
@ -441,12 +457,12 @@
|_ now/@da
++ beck
^- slyd
|= {* fur/(unit (set monk)) ron/term bed/beam}
^- (unit (unit (cask)))
|= {typ/* fur/(unit (set monk)) ron/term bed/beam}
^- (unit (unit (cask milt)))
=> .(fur ?^(fur fur `[[%& p.bed] ~ ~])) :: XX heinous
=+ lal=(end 3 1 ron)
=+ ren=(@t (rsh 3 1 ron))
|- ^- (unit (unit (cask)))
|- ^- (unit (unit (cask milt)))
?~ vanes ~
?. =(lal label.i.vanes) $(vanes t.vanes)
~| [%failed-scry ron bed]

View File

@ -5570,7 +5570,7 @@
%- sloy ^- slyd
~/ %intercepted-scry
|= [ref=* (unit (set monk)) =term =beam]
^- (unit (unit (cask)))
^- (unit (unit (cask milt)))
:: if the actual scry produces a value, use that value; otherwise use local
::
=/ scry-response (scry +<.$)
@ -5606,7 +5606,7 @@
?. -:(nets:wa +.ref `type`p.q.local-cage)
[~ ~]
::
[~ ~ `(cask)`local-cage]
[~ ~ local-cage]
:: +unblock-clients-on-duct: unblock and produce clients blocked on :build
::
++ unblock-clients-on-duct