mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-03 12:42:48 +03:00
Rename ++span to ++type.
This commit is contained in:
parent
260c9a4479
commit
c7e73c22f9
104
app/dojo.hoon
104
app/dojo.hoon
@ -21,7 +21,7 @@
|
||||
$: say/sole-share :: command-line state
|
||||
dir/beam :: active path
|
||||
poy/(unit dojo-project) :: working
|
||||
{lib/(list hoof:ford) sur/(list hoof:ford)} :: lib+sur
|
||||
{lib/(list hoof:ford) sur/(list hoof:ford)} :: lib+sur
|
||||
var/(map term cage) :: variable state
|
||||
old/(set term) :: used TLVs
|
||||
buf/tape :: multiline buffer
|
||||
@ -41,7 +41,7 @@
|
||||
r/purl:eyre
|
||||
==
|
||||
{$poke p/goal} :: poke app
|
||||
{$show p/?($0 $1 $2 $3)} :: print val+span+twig
|
||||
{$show p/?($0 $1 $2 $3)} :: print val+type+twig
|
||||
{$verb p/term} :: store variable
|
||||
{$help p/(list term)} :: look up help
|
||||
== ::
|
||||
@ -536,7 +536,7 @@
|
||||
?- p.p.mad
|
||||
$0 ~
|
||||
$1 [[%rose [~ " " ~] (skol p.q.cay) ~] (mar)]
|
||||
$2 [[%rose [~ " " ~] (dy-show-span-noun p.q.cay) ~] (mar)]
|
||||
$2 [[%rose [~ " " ~] (dy-show-type-noun p.q.cay) ~] (mar)]
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -558,17 +558,17 @@
|
||||
==
|
||||
::
|
||||
++ dy-inspect
|
||||
|= {topic/(list term) sut/span}
|
||||
|= {topic/(list term) sut/type}
|
||||
%+ dy-rash %tan
|
||||
|^ ^- tang
|
||||
=+ to-display=(find-item-in-span (flop topic) sut)
|
||||
=+ to-display=(find-item-in-type (flop topic) sut)
|
||||
?~ to-display
|
||||
[%leaf "Could not find help"]~
|
||||
(flop (print-item u.to-display))
|
||||
:> # %models
|
||||
+|
|
||||
::
|
||||
:> an overview of all named things in the span.
|
||||
:> an overview of all named things in the type.
|
||||
:>
|
||||
:> each item in the overview list is either a documentation for a sublist
|
||||
:> or an association between a term and documentation for it.
|
||||
@ -582,15 +582,15 @@
|
||||
{$item name/tape doc/what}
|
||||
==
|
||||
::
|
||||
:> the part of a {span} being inspected.
|
||||
:> the part of a {type} being inspected.
|
||||
++ item
|
||||
$% :> overview of span
|
||||
$% :> overview of type
|
||||
{$view items/overview}
|
||||
:> inspecting a full core.
|
||||
$: $core
|
||||
name/tape
|
||||
docs/what
|
||||
sut/span
|
||||
sut/type
|
||||
con/coil
|
||||
children/(unit item)
|
||||
==
|
||||
@ -599,13 +599,13 @@
|
||||
name/tape
|
||||
docs/what
|
||||
f/foot
|
||||
sut/span
|
||||
sut/type
|
||||
==
|
||||
:> inspecting a single chapter on a core.
|
||||
$: $chapter
|
||||
name/tape
|
||||
docs/what
|
||||
sut/span
|
||||
sut/type
|
||||
con/coil
|
||||
chapter-id/@
|
||||
==
|
||||
@ -623,11 +623,11 @@
|
||||
+|
|
||||
:> returns the item to print while searching through {topic}.
|
||||
:>
|
||||
:> this gate is called recursively to find the path {topic} in the span
|
||||
:> {sut}. once it finds the correct part of the span, it switches to
|
||||
:> ++build-inspectable-recursively to describe that part of the span.
|
||||
++ find-item-in-span
|
||||
|= {topics/(list term) sut/span}
|
||||
:> this gate is called recursively to find the path {topic} in the type
|
||||
:> {sut}. once it finds the correct part of the type, it switches to
|
||||
:> ++build-inspectable-recursively to describe that part of the type.
|
||||
++ find-item-in-type
|
||||
|= {topics/(list term) sut/type}
|
||||
^- (unit item)
|
||||
?~ topics
|
||||
:: we have no more search path. return the rest as an overview
|
||||
@ -682,31 +682,31 @@
|
||||
~
|
||||
?~ t.topics
|
||||
`[%face (trip q.p.sut) p.p.sut (build-inspectable-recursively q.sut)]
|
||||
(find-item-in-span t.topics q.sut)
|
||||
(find-item-in-type t.topics q.sut)
|
||||
::
|
||||
{$fork *}
|
||||
=/ spans/(list span) ~(tap in p.sut)
|
||||
=/ types/(list type) ~(tap in p.sut)
|
||||
|-
|
||||
?~ spans
|
||||
?~ types
|
||||
~
|
||||
=+ res=(find-item-in-span topics i.spans)
|
||||
=+ res=(find-item-in-type topics i.types)
|
||||
?~ res
|
||||
$(spans t.spans)
|
||||
$(types t.types)
|
||||
res
|
||||
::
|
||||
{$help *}
|
||||
:: while we found a raw help, it's associated on the wrong side of a
|
||||
:: set of topics. Walk through it instead of showing it.
|
||||
(find-item-in-span t.topics q.sut)
|
||||
(find-item-in-type t.topics q.sut)
|
||||
::
|
||||
{$hold *} $(sut (~(play ut p.sut) q.sut))
|
||||
$noun ~
|
||||
$void ~
|
||||
==
|
||||
::
|
||||
:> changes a {span} into an {item}.
|
||||
:> changes a {type} into an {item}.
|
||||
++ build-inspectable-recursively
|
||||
|= sut/span
|
||||
|= sut/type
|
||||
^- (unit item)
|
||||
?- sut
|
||||
::
|
||||
@ -730,13 +730,13 @@
|
||||
`[%face (trip q.p.sut) p.p.sut compiled-against]
|
||||
::
|
||||
{$fork *}
|
||||
=* spans ~(tap in p.sut)
|
||||
=* items (turn spans build-inspectable-recursively)
|
||||
=* types ~(tap in p.sut)
|
||||
=* items (turn types build-inspectable-recursively)
|
||||
(roll items join-items)
|
||||
::
|
||||
{$help *}
|
||||
=* rest-span (build-inspectable-recursively q.sut)
|
||||
`[%view [%header p.sut (item-as-overview rest-span)]~]
|
||||
=* rest-type (build-inspectable-recursively q.sut)
|
||||
`[%view [%header p.sut (item-as-overview rest-type)]~]
|
||||
::
|
||||
{$hold *} $(sut (~(play ut p.sut) q.sut))
|
||||
$noun ~
|
||||
@ -782,7 +782,7 @@
|
||||
::
|
||||
:> translate the internals of a core's {tomb} into an {overview}.
|
||||
++ arms-as-overview
|
||||
|= {a/(map term (pair what foot)) sut/span}
|
||||
|= {a/(map term (pair what foot)) sut/type}
|
||||
^- overview
|
||||
%+ turn ~(tap by a)
|
||||
|= (pair term (pair what foot))
|
||||
@ -807,7 +807,7 @@
|
||||
:> returns an overview for arms which are part of unnamed chapters,
|
||||
:> and an overview of the named chapters.
|
||||
++ arm-and-chapter-overviews
|
||||
|= {sut/span con/coil core-name/tape}
|
||||
|= {sut/type con/coil core-name/tape}
|
||||
^- {overview overview}
|
||||
=| arm-docs/overview :< documented arms
|
||||
=| chapter-docs/overview :< documented chapters
|
||||
@ -830,7 +830,7 @@
|
||||
::
|
||||
:> returns an overview of the arms in a specific chapter.
|
||||
++ arms-in-chapter
|
||||
|= {sut/span con/coil chapter-id/@}
|
||||
|= {sut/type con/coil chapter-id/@}
|
||||
^- overview
|
||||
=* chapter-tomb (~(got by q.s.con) chapter-id)
|
||||
(sort-overview (arms-as-overview q.chapter-tomb sut))
|
||||
@ -850,8 +850,8 @@
|
||||
{$item *} name.ovr
|
||||
==
|
||||
::
|
||||
++ what-from-span
|
||||
|= sut/span
|
||||
++ what-from-type
|
||||
|= sut/type
|
||||
?+ sut ~
|
||||
{$core *} q.r.q.sut
|
||||
{$help *} p.sut
|
||||
@ -876,7 +876,7 @@
|
||||
::
|
||||
:> renders the documentation for a full core.
|
||||
++ print-core
|
||||
|= {core-name/tape docs/what sut/span con/coil uit/(unit item)}
|
||||
|= {core-name/tape docs/what sut/type con/coil uit/(unit item)}
|
||||
^- tang
|
||||
=+ [arms chapters]=(arm-and-chapter-overviews sut con core-name)
|
||||
;: weld
|
||||
@ -902,19 +902,19 @@
|
||||
:> figures out which {what}s to use.
|
||||
:>
|
||||
:> there are three places with a relevant {what}: the {arm-doc} on the
|
||||
:> arm, the {what} in the computed span of the foot, and the {what} on
|
||||
:> the product of the default arm when the computed span is a core.
|
||||
:> arm, the {what} in the computed type of the foot, and the {what} on
|
||||
:> the product of the default arm when the computed type is a core.
|
||||
++ select-arm-docs
|
||||
|= {arm-doc/what f/foot sut/span}
|
||||
|= {arm-doc/what f/foot sut/type}
|
||||
:> the computed arm documentation and the product documentation.
|
||||
^- {what what}
|
||||
=+ foot-span=(~(play ut sut) p.f)
|
||||
=+ raw-product=(what-from-span foot-span)
|
||||
=+ foot-type=(~(play ut sut) p.f)
|
||||
=+ raw-product=(what-from-type foot-type)
|
||||
=/ product-product/what
|
||||
?. ?=({$core *} foot-span)
|
||||
?. ?=({$core *} foot-type)
|
||||
~
|
||||
=* inner-span (~(play ut foot-span) [%limb %$])
|
||||
(what-from-span inner-span)
|
||||
=* inner-type (~(play ut foot-type) [%limb %$])
|
||||
(what-from-type inner-type)
|
||||
:-
|
||||
?~ arm-doc
|
||||
raw-product
|
||||
@ -925,7 +925,7 @@
|
||||
::
|
||||
:> renders the documentation for a single arm in a core.
|
||||
++ print-arm
|
||||
|= {arm-name/tape arm-doc/what f/foot sut/span}
|
||||
|= {arm-name/tape arm-doc/what f/foot sut/type}
|
||||
:: todo: need to get the sample here. also hoist this to the general
|
||||
:: core printing machinery, too.
|
||||
=+ [main-doc product-doc]=(select-arm-docs arm-doc f sut)
|
||||
@ -939,7 +939,7 @@
|
||||
::
|
||||
:> renders the documentation for a chapter in a core.
|
||||
++ print-chapter
|
||||
|= {name/tape doc/what sut/span con/coil chapter-id/@}
|
||||
|= {name/tape doc/what sut/type con/coil chapter-id/@}
|
||||
;: weld
|
||||
(print-header name doc)
|
||||
::
|
||||
@ -1114,8 +1114,8 @@
|
||||
$(ret l, c t.c)
|
||||
$(c t.c)
|
||||
::
|
||||
++ dy-show-span-noun
|
||||
|= a/span ^- tank
|
||||
++ dy-show-type-noun
|
||||
|= a/type ^- tank
|
||||
=- >[-]<
|
||||
|- ^- $? $% {$atom @tas (unit @)}
|
||||
{$cell _$ _$}
|
||||
@ -1130,7 +1130,7 @@
|
||||
?+ a a
|
||||
{?($cube $face) ^} 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/span ^$(a b)))))
|
||||
{$fork *} a(p (silt (turn ~(tap in p.a) |=(b/type ^$(a b)))))
|
||||
{$help *} !!
|
||||
{$core ^} `wain`/core
|
||||
{$hold *} a(p $(a p.a))
|
||||
@ -1180,7 +1180,7 @@
|
||||
(dy-diff %mor [%det lic] [%bel ~] ~)
|
||||
(dy-slam(per `dat) /edit u.pro !>((tufa buf.say)))
|
||||
::
|
||||
++ dy-span :: sole action
|
||||
++ dy-type :: sole action
|
||||
|= act/sole-action
|
||||
?- -.act
|
||||
$det (dy-edit +.act)
|
||||
@ -1574,11 +1574,11 @@
|
||||
==
|
||||
==
|
||||
::
|
||||
++ he-span :: apply input
|
||||
++ he-type :: apply input
|
||||
|= act/sole-action
|
||||
^+ +>
|
||||
?^ poy
|
||||
he-pine:(~(dy-span dy u.poy) act)
|
||||
he-pine:(~(dy-type dy u.poy) act)
|
||||
?- -.act
|
||||
$det (he-stir +.act)
|
||||
$ret (he-done (tufa buf.say))
|
||||
@ -1704,7 +1704,7 @@
|
||||
|= {moz/(list move) ses/session}
|
||||
=> ~(. he moz ses)
|
||||
=- [wrap=- +]
|
||||
|* he-arm/_he-span
|
||||
|* he-arm/_he-type
|
||||
|= _+<.he-arm
|
||||
^- (quip move _..he)
|
||||
he-abet:(he-arm +<)
|
||||
@ -1721,7 +1721,7 @@
|
||||
::
|
||||
++ poke-sole-action
|
||||
|= act/sole-action ~| poke+act %. act
|
||||
(wrap he-span):arm
|
||||
(wrap he-type):arm
|
||||
::
|
||||
++ poke-lens-command
|
||||
|= com/command:lens ~| poke-lens+com %. com
|
||||
|
429
sys/hoon.hoon
429
sys/hoon.hoon
File diff suppressed because it is too large
Load Diff
@ -26,9 +26,9 @@
|
||||
$: p/(unit (set monk)) :: can be read by
|
||||
q/(set monk) :: caused or created by
|
||||
== ::
|
||||
++ curd {p/@tas q/*} :: spanless card
|
||||
++ curd {p/@tas q/*} :: typeless card
|
||||
++ duct (list wire) :: causal history
|
||||
++ hypo |*(a/mold (pair span a)) :: span associated
|
||||
++ hypo |*(a/mold (pair type a)) :: type associated
|
||||
++ hobo |* a/mold :: kiss wrapper
|
||||
$? $% {$soft p/*} ::
|
||||
== ::
|
||||
@ -48,7 +48,7 @@
|
||||
$@ mark :: plain mark
|
||||
$% {$tabl p/(list (pair marc marc))} :: map
|
||||
== ::
|
||||
++ mark @tas :: content span
|
||||
++ mark @tas :: content type
|
||||
++ mash |=(* (mass +<)) :: producing mass
|
||||
++ mass (pair cord (each noun (list mash))) :: memory usage
|
||||
++ mill (each vase milt) :: vase+metavase
|
||||
@ -56,7 +56,7 @@
|
||||
++ monk (each ship {p/@tas q/@ta}) :: general identity
|
||||
++ muse {p/@tas q/duct r/arvo} :: sourced move
|
||||
++ move {p/duct q/arvo} :: arvo move
|
||||
++ ovum {p/wire q/curd} :: spanless ovum
|
||||
++ ovum {p/wire q/curd} :: typeless ovum
|
||||
++ pane (list {p/@tas q/vase}) :: kernel modules
|
||||
++ pone (list {p/@tas q/vise}) :: kernel modules old
|
||||
++ ship @p :: network identity
|
||||
@ -67,10 +67,10 @@
|
||||
(unit (unit (cask))) ::
|
||||
++ slyt $-({* *} (unit (unit))) :: old namespace
|
||||
++ vile :: reflexive constants
|
||||
$: typ/span :: -:!>(*span)
|
||||
duc/span :: -:!>(*duct)
|
||||
pah/span :: -:!>(*path)
|
||||
mev/span :: -:!>([%meta *vase])
|
||||
$: typ/type :: -:!>(*type)
|
||||
duc/type :: -:!>(*duct)
|
||||
pah/type :: -:!>(*path)
|
||||
mev/type :: -:!>([%meta *vase])
|
||||
== ::
|
||||
++ wind :: new kernel action
|
||||
|* {a/mold b/mold} :: forward+reverse
|
||||
@ -192,9 +192,9 @@
|
||||
?. hip ~ :: a vase is a cell
|
||||
=^ vax p.sew (~(slot wa p.sew) 2 tiv) ::
|
||||
=^ hip p.sew (~(nest wa p.sew) typ.vil p.vax) ::
|
||||
?. hip ~ :: vase head is span
|
||||
?. hip ~ :: vase head is type
|
||||
%+ biff ::
|
||||
=+ mut=(milt q.tiv) :: card span, value
|
||||
=+ mut=(milt q.tiv) :: card type, value
|
||||
|- ^- (unit (pair milt worm)) ::
|
||||
?. ?=({$meta p/* q/milt} q.mut) `[mut p.sew] :: ordinary metacard
|
||||
=^ hip p.sew (~(nets wa p.sew) mev.vil p.mut)::
|
||||
@ -328,10 +328,10 @@
|
||||
(vent lal vil bud *worm (slym (slap bud (rain pax txt)) bud))
|
||||
::
|
||||
++ viol :: vane tools
|
||||
|= but/span
|
||||
|= but/type
|
||||
^- vile
|
||||
=+ pal=|=(a/@t ^-(span (~(play ut but) (vice a))))
|
||||
:* typ=(pal '*span')
|
||||
=+ pal=|=(a/@t ^-(type (~(play ut but) (vice a))))
|
||||
:* typ=(pal '*type')
|
||||
duc=(pal '*duct')
|
||||
pah=(pal '*path')
|
||||
mev=(pal '*{$meta $vase}')
|
||||
|
@ -71,8 +71,8 @@
|
||||
{$bake p/calm q/(pair mark beam) r/(unit vase)} :: load
|
||||
{$boil p/calm q/(trel coin beam beam) r/vase} :: execute
|
||||
{$path p/calm q/beam r/(unit beam)} :: -to/ transformation
|
||||
{$slit p/calm q/{p/span q/span} r/span} :: slam type
|
||||
{$slim p/calm q/{p/span q/twig} r/(pair span nock)}:: mint
|
||||
{$slit p/calm q/{p/type q/type} r/type} :: slam type
|
||||
{$slim p/calm q/{p/type q/twig} r/(pair type nock)}:: mint
|
||||
{$slap p/calm q/{p/vase q/twig} r/vase} :: compute
|
||||
{$slam p/calm q/{p/vase q/vase} r/vase} :: compute
|
||||
== ::
|
||||
@ -92,7 +92,7 @@
|
||||
-- ::
|
||||
|% ::
|
||||
++ calf :: reduce calx
|
||||
|* sem/* :: a spansystem hack
|
||||
|* sem/* :: a typesystem hack
|
||||
|= cax/calx
|
||||
?+ sem !!
|
||||
$hood ?>(?=($hood -.cax) r.cax)
|
||||
@ -953,7 +953,7 @@
|
||||
=< |. ^- tank
|
||||
:+ %palm [" " ~ ~ ~]
|
||||
~[leaf+"ford: keel" rose+[" " ~ ~]^(murn yom +)]
|
||||
|= {a/wing b/span *} ^- (unit tank)
|
||||
|= {a/wing b/type *} ^- (unit tank)
|
||||
=+ typ=(mule |.(p:(slap suh wing+a)))
|
||||
?: ?=($| -.typ)
|
||||
(some (show [%c %pull] %l a))
|
||||
@ -1035,10 +1035,10 @@
|
||||
?~ von [p=cof q=[%1 [%c %w bem ~] ~ ~]]
|
||||
(fine cof bem(r [%ud ((hard @) +.+:(need u.von))]))
|
||||
::
|
||||
++ lane :: span infer
|
||||
|= {cof/cafe typ/span gen/twig}
|
||||
++ lane :: type infer
|
||||
|= {cof/cafe typ/type gen/twig}
|
||||
%+ (cowl cof) (mule |.((~(play ut typ) gen)))
|
||||
|=(ref/span ref)
|
||||
|=(ref/type ref)
|
||||
::
|
||||
++ lash :: filter at beam
|
||||
|* {cof/cafe bem/beam fun/(burg knot (unit))}
|
||||
@ -1211,10 +1211,10 @@
|
||||
::
|
||||
++ mail :: cached mint
|
||||
~/ %mail
|
||||
|= {cof/cafe sut/span gen/twig}
|
||||
^- (bolt (pair span nock))
|
||||
|= {cof/cafe sut/type gen/twig}
|
||||
^- (bolt (pair type nock))
|
||||
%+ (clef %slim) (fine cof sut gen)
|
||||
|= {cof/cafe sut/span gen/twig}
|
||||
|= {cof/cafe sut/type gen/twig}
|
||||
=+ puz=(mule |.((~(mint ut sut) [%noun gen])))
|
||||
?- -.puz
|
||||
$| (flaw cof p.puz)
|
||||
@ -1226,7 +1226,7 @@
|
||||
|= {cof/cafe vax/vase gen/twig}
|
||||
^- (bolt vase)
|
||||
%+ cope (mail cof p.vax gen)
|
||||
|= {cof/cafe typ/span fol/nock}
|
||||
|= {cof/cafe typ/type fol/nock}
|
||||
%+ (coup cof) (mock [q.vax fol] (sloy syve))
|
||||
|=(val/* `vase`[typ val])
|
||||
::
|
||||
@ -1416,10 +1416,10 @@
|
||||
::
|
||||
++ malt :: cached slit
|
||||
~/ %slit
|
||||
|= {cof/cafe gat/span sam/span}
|
||||
^- (bolt span)
|
||||
|= {cof/cafe gat/type sam/type}
|
||||
^- (bolt type)
|
||||
%+ (clef %slit) (fine cof gat sam)
|
||||
|= {cof/cafe gat/span sam/span}
|
||||
|= {cof/cafe gat/type sam/type}
|
||||
%+ cool |.(%.(%have ~(dunk ut sam)))
|
||||
%+ cool |.(%.(%want ~(dunk ut (~(peek ut gat) %free 6))))
|
||||
=+ top=(mule |.((slit gat sam)))
|
||||
@ -1433,7 +1433,7 @@
|
||||
|= {cof/cafe gat/vase sam/vase}
|
||||
^- (bolt vase)
|
||||
%+ cope (malt cof p.gat p.sam)
|
||||
|= {cof/cafe typ/span}
|
||||
|= {cof/cafe typ/type}
|
||||
%+ (coup cof) (mong [q.gat q.sam] (sloy syve))
|
||||
|=(val/* `vase`[typ val])
|
||||
::
|
||||
@ -1867,9 +1867,9 @@
|
||||
%- %- lift |= (unit cage) :: ignore block
|
||||
%+ biff +<
|
||||
|= cay/cage ^- (unit cage)
|
||||
?. -:(nets:wa +.ref `span`p.q.cay) :: error if bad type
|
||||
?. -:(nets:wa +.ref `type`p.q.cay) :: error if bad type
|
||||
~& :^ %ford-syve-lost `path`[tem (en-beam bem)]
|
||||
want=;;(span +.ref)
|
||||
want=;;(type +.ref)
|
||||
have=p.q.cay
|
||||
~
|
||||
`cay
|
||||
|
@ -39,7 +39,7 @@
|
||||
++ roof (room vase) :: namespace
|
||||
++ room :: either namespace
|
||||
|* vase/mold :: vase or maze
|
||||
$- $: ref/* :: reference span
|
||||
$- $: ref/* :: reference type
|
||||
lyc/(unit (set ship)) :: leakset
|
||||
car/term :: perspective
|
||||
bem/beam :: path
|
||||
|
Loading…
Reference in New Issue
Block a user