@@ -4660,6 +4660,14 @@
4660:: proofs to fewer than 1,024 cells; the projection planner has a separate
4660:: proofs to fewer than 1,024 cells; the projection planner has a separate
4661:: 4,096-step bound. These are inference limits, not language limits.
4661:: 4,096-step bound. These are inference limits, not language limits.
4663+:: `unface` is reserved with proj (+reserved-name) and is also handled by
4664+:: type: (unface e) has e's type with every face removed, through cells,
4665+:: gates and collection arguments, keeping unions and recursive molds
4666+:: whole (+itype-unface). It is not a value, it takes one argument, and
4667+:: a bare type variable is unsupported, as field access on one is. A ++
4668+:: whose body is (unface |= …) is a gate for recursion (+unfaced-gate).
4669+:: It lowers to its argument; no lowering is implemented yet.
4663:: Supported API imports derive request-gate types atomically for multiple
4671:: Supported API imports derive request-gate types atomically for multiple
4664:: paths, including one typed segment or one diff fold per case. Their checked
4672:: paths, including one typed segment or one diff fold per case. Their checked
4665:: ordinary definitions, mark molds and supported poke constructor are also
4673:: ordinary definitions, mark molds and supported poke constructor are also
@@ -4967,6 +4975,35 @@
4967 $(a tal.a, b tal.b, sub u.first)
4975 $(a tal.a, b tal.b, sub u.first)
4978+:: +itype-unface: t with every face removed, for (unface e)
4980+:: It strips through cells, through a gate's sample and product and
4981+:: through a built-in collection's arguments, the prelude's unit
4982+:: included, walking bound variables. Other unions and recursive
4983+:: molds are compared by name or by their exact cases, so stripping
4984+:: inside them would stop them from fitting their own name: they are
4985+:: kept whole. An unbound variable stays, so faces it is bound to
4986+:: later are kept. The unit keeps its own u=, as a list keeps i= and
4990+ |= [t=itype sub=isub]
4992+ =. t (itype-walk t sub)
4995+ %cell [%cell $(t hed.t) $(t tal.t)]
4996+ %fn [%fn $(t sample.t) $(t product.t)]
4997+ %collection [%collection name.t (turn args.t |=(a=itype ^$(t a)))]
4999+ ?. =(origin.t `[/lib/jibb/prelude/jibb %unit]) t
5000+ ?. ?=([* ~] args.t) t
5001+ =/ nil=itype [%const [%null %n 0 '~']]
5002+ ?. =(cases.t ~[nil [%cell nil [%face %u i.args.t]]]) t
5003+ =/ arg=itype $(t i.args.t)
5004+ t(cases ~[nil [%cell nil [%face %u arg]]], args ~[arg])
4970+$ igf-form [typ=itype sub=isub left=@ud]
5007+$ igf-form [typ=itype sub=isub left=@ud]
4971+$ igf-forms [types=(list itype) sub=isub left=@ud]
5008+$ igf-forms [types=(list itype) sub=isub left=@ud]
4972++ itype-gate-free-forms
5009++ itype-gate-free-forms
@@ -7367,12 +7404,12 @@
7367 ^- isample-result
7404 ^- isample-result
7370− ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
7407+ ?: |((reserved-name name.s) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
7371 [%| "sample shadows a name"]
7408 [%| "sample shadows a name"]
7372 =/ t=itype [%var next.state]
7409 =/ t=itype [%var next.state]
7373 [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
7410 [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
7375− ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
7412+ ?: |((reserved-name name.s) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
7376 [%| "sample shadows a name"]
7413 [%| "sample shadows a name"]
7377 =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
7414 =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
7378 ?~ t [%| "sample mold is not supported by partial inference"]
7415 ?~ t [%| "sample mold is not supported by partial inference"]
@@ -7440,7 +7477,7 @@
7442 ?: ?=(%mold -.i.ds) $(ds t.ds)
7479 ?: ?=(%mold -.i.ds) $(ds t.ds)
7443− ?: =(name.i.ds %proj) |
7480+ ?: (reserved-name name.i.ds) |
7444 ?. (unique-value-name name.i.ds names) |
7481 ?. (unique-value-name name.i.ds names) |
7445 ?: ?=(^ (ienv-lookup name.i.ds env)) |
7482 ?: ?=(^ (ienv-lookup name.i.ds env)) |
7446 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
7483 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
@@ -7464,7 +7501,7 @@
7465 ?~ locals &
7502 ?~ locals &
7466 =/ n=term name.i.locals
7503 =/ n=term name.i.locals
7467− ?: =(n %proj) |
7504+ ?: (reserved-name n) |
7468 ?. (unique-value-name n names) |
7505 ?. (unique-value-name n names) |
7469 ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
7506 ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
7470 ?: (lien marks.state |=(m=term =(n m))) |
7507 ?: (lien marks.state |=(m=term =(n m))) |
@@ -8144,7 +8181,7 @@
8144 [%| ["list branch pattern is not supported by partial inference" ~]]
8181 [%| ["list branch pattern is not supported by partial inference" ~]]
8145 =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
8182 =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
8146 ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
8183 ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
8147− ?: |(=(head.u.binder %proj) =(tail.u.binder %proj) =(head.u.binder tail.u.binder) ?=(^ (ienv-lookup head.u.binder env)) ?=(^ (ienv-lookup tail.u.binder env)) (lien globals.state |=(n=term |(=(n head.u.binder) =(n tail.u.binder)))))
8184+ ?: |((reserved-name head.u.binder) (reserved-name tail.u.binder) =(head.u.binder tail.u.binder) ?=(^ (ienv-lookup head.u.binder env)) ?=(^ (ienv-lookup tail.u.binder env)) (lien globals.state |=(n=term |(=(n head.u.binder) =(n tail.u.binder)))))
8148 [%| ["pattern binder shadows a name" ~]]
8185 [%| ["pattern binder shadows a name" ~]]
8149 =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
8186 =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
8150 =/ left=iresult
8187 =/ left=iresult
@@ -8181,7 +8218,7 @@
8181 [%| ["unit branch pattern is not supported by partial inference" ~]]
8218 [%| ["unit branch pattern is not supported by partial inference" ~]]
8182 =/ binder=(unit term) ?:(first-empty second-name first-name)
8219 =/ binder=(unit term) ?:(first-empty second-name first-name)
8183 ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
8220 ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
8184− ?: |(=(u.binder %proj) ?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
8221+ ?: |((reserved-name u.binder) ?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
8185 [%| ["pattern binder shadows a name" ~]]
8222 [%| ["pattern binder shadows a name" ~]]
8186 =/ payload=(unit itype) (unit-union-payload typ)
8223 =/ payload=(unit itype) (unit-union-payload typ)
8187 ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
8224 ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
@@ -8288,7 +8325,7 @@
8288 ^- (unit ienv)
8325 ^- (unit ienv)
8289 =. t ?:(?=(%face -.t) body.t t)
8326 =. t ?:(?=(%face -.t) body.t t)
8290 ?: ?=(%bind -.p)
8327 ?: ?=(%bind -.p)
8291− ?: |(=(name.p %proj) ?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
8328+ ?: |((reserved-name name.p) ?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
8292 `[[name.p [t ~]] env]
8329 `[[name.p [t ~]] env]
8293 ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
8330 ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
@@ -9278,6 +9315,7 @@
9278 [%& typ.instance state.instance]
9315 [%& typ.instance state.instance]
9279 =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
9316 =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
9280 ?~ scheme
9317 ?~ scheme
9318+ ?: =(i.names.e %unface) [%| (unface-value at.e)]
9281 ?~ prelude.state [%| ["name is not available to partial inference" ~]]
9319 ?~ prelude.state [%| ["name is not available to partial inference" ~]]
9282 =/ prelude-entry=(unit ischeme) (ienv-lookup i.names.e values.u.prelude.state)
9320 =/ prelude-entry=(unit ischeme) (ienv-lookup i.names.e values.u.prelude.state)
9283 ?~ prelude-entry [%| ["name is not available to partial inference" ~]]
9321 ?~ prelude-entry [%| ["name is not available to partial inference" ~]]
@@ -9285,7 +9323,10 @@
9285 [%& typ.inst state.inst]
9323 [%& typ.inst state.inst]
9286 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
9324 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
9287 [%& typ.instance state.instance]
9325 [%& typ.instance state.instance]
9327+ ?: &(?=(%wing -.inner.e) =(names.inner.e ~[%unface]) ?=(~ (ienv-lookup %unface env)))
9328+ [%| ["unface takes one argument, as (unface e)" ~[[at.e "unface call"]]]]
9288− %group $(e inner.e)
9329+ $(e inner.e)
9290 ?~ edits.e [%| ["a change takes at least one field" ~[[at.e "empty change"]]]]
9331 ?~ edits.e [%| ["a change takes at least one field" ~[[at.e "empty change"]]]]
9291 =/ target=iresult $(e [%wing at.e target.e])
9332 =/ target=iresult $(e [%wing at.e target.e])
@@ -9429,6 +9470,7 @@
9429 ?~ args.e [%| ["call has no argument" ~]]
9470 ?~ args.e [%| ["call has no argument" ~]]
9430 ?: (explicit-proj-call e env state)
9471 ?: (explicit-proj-call e env state)
9431 [%| ["proj needs an expected record type" ~]]
9472 [%| ["proj needs an expected record type" ~]]
9473+ ?: (reserved-call %unface e env state) (infer-unface e env state)
9432 (infer-call-with-head e env state (infer-fragment head.e env state))
9474 (infer-call-with-head e env state (infer-fragment head.e env state))
9433 * [%| ["expression is not supported by partial inference" ~]]
9475 * [%| ["expression is not supported by partial inference" ~]]
@@ -9819,6 +9861,7 @@
9819 ^- iresult
9861 ^- iresult
9820 ?> ?=(%call -.e)
9862 ?> ?=(%call -.e)
9821 ?~ args.e [%| ["call has no argument" ~]]
9863 ?~ args.e [%| ["call has no argument" ~]]
9864+ ?: (reserved-call %unface e env state) (infer-unface e env state)
9822 =/ head=iresult (infer-fragment head.e env state)
9865 =/ head=iresult (infer-fragment head.e env state)
9823 ?: ?=(%| -.head) head
9866 ?: ?=(%| -.head) head
9824 =/ ht=itype (itype-walk typ.p.head sub.state.p.head)
9867 =/ ht=itype (itype-walk typ.p.head sub.state.p.head)
@@ -9901,18 +9944,70 @@
9901 `(infer-simple-items items.e env state)
9944 `(infer-simple-items items.e env state)
9902 `(width-infer-items items.e index.u.target env state context)
9945 `(width-infer-items items.e index.u.target env state context)
9947+:: +reserved-call: whether e calls the reserved operation n
9904−:: Experimental intrinsic recognition; real bindings retain normal calls.
9949+:: Experimental intrinsic recognition; real bindings retain normal calls.
9951+ |= [n=term e=expr env=ienv state=istate]
9954+ ?. ?=(%wing -.head.e) |
9955+ ?. =(names.head.e ~[n]) |
9956+ ?: ?=(^ (ienv-lookup n env)) |
9957+ ?: (lien globals.state |=(x=term =(x n))) |
9959+ ?:(?=(^ (ienv-lookup n values.u.prelude.state)) | &)
9905++ explicit-proj-call
9960++ explicit-proj-call
9906 |= [e=expr env=ienv state=istate]
9961 |= [e=expr env=ienv state=istate]
9908 ?. ?=(%call -.e) |
9963 ?. ?=(%call -.e) |
9909 ?. ?=([* ~] args.e) |
9964 ?. ?=([* ~] args.e) |
9910− ?. ?=(%wing -.head.e) |
9965+ (reserved-call %proj e env state)
9911− ?. =(names.head.e ~[%proj]) |
9966+::
9912− ?: ?=(^ (ienv-lookup %proj env)) |
9967+:: +infer-unface: (unface e), e's type with every face removed
9913− ?: (lien globals.state |=(n=term =(n %proj))) |
9968+::
9914− ?~ prelude.state &
9969+:: A reserved operation handled by type, like proj. Any number of
9915− ?:(?=(^ (ienv-lookup %proj values.u.prelude.state)) | &)
9970+:: arguments is taken here so that a wrong count is an error. A type
9971+:: not yet known would wait, as wing access does; the partial checker
9972+:: has no such wait and reports it as unsupported, as it does field
9973+:: access on such a type.
9975+ |= [e=expr env=ienv state=istate]
9978+ ?. ?=([* ~] args.e)
9979+ [%| ["unface takes one argument, as (unface e)" ~[[at.e "unface call"]]]]
9980+ ?^ defer.state [%| ["deferred unface needs unsupported inference" ~]]
9981+ =/ value=iresult (infer-fragment i.args.e env state)
9982+ ?: ?=(%| -.value) value
9983+ =/ typ=itype (itype-walk typ.p.value sub.state.p.value)
9984+ ?: ?=(?(%var %fvar) -.typ)
9985+ [%| ["unface on a type not yet known is not supported by partial inference" ~]]
9986+ [%& (itype-unface typ sub.state.p.value) state.p.value]
9988+:: +unface-value: the error for unface written where a value goes
9993+ ["unface is not a value; write |=(g (unface g))" ~[[at "unface used as a value"]]]
9995+:: +unfaced-gate: the gate under a ++'s (unface |= …), or ~
9997+:: Such a ++ is a gate for recursion: its own name has the unfaced
9998+:: type, and its body may call it.
10000+ |= [e=expr env=ienv state=istate]
10002+ ?: ?=(%group -.e) $(e inner.e)
10003+ ?. (reserved-call %unface e env state) ~
10005+ ?. ?=([* ~] args.e) ~
10006+ =/ gate=expr i.args.e
10008+ ?: ?=(%group -.gate) $(gate inner.gate)
10009+ ?. ?=(?(%gate %gate-wide) -.gate) ~
9916++ infer-proj-source
10011++ infer-proj-source
9917 |= [e=expr expected=itype env=ienv state=istate context=span]
10012 |= [e=expr expected=itype env=ienv state=istate context=span]
9918 ^- iresult
10013 ^- iresult
@@ -10319,7 +10414,7 @@
10319 ?~ pats [%& ~]
10414 ?~ pats [%& ~]
10320 ?. ?=(%bind -.i.pats) [%| 'branch pattern is not supported by partial inference']
10415 ?. ?=(%bind -.i.pats) [%| 'branch pattern is not supported by partial inference']
10321 =/ name=term name.i.pats
10416 =/ name=term name.i.pats
10322− ?: |(=(name %proj) ?=(^ (ienv-lookup name env)) (lien globals |=(n=term =(n name))) (lien seen |=(n=term =(n name))))
10417+ ?: |((reserved-name name) ?=(^ (ienv-lookup name env)) (lien globals |=(n=term =(n name))) (lien seen |=(n=term =(n name))))
10323 [%| 'pattern shadows a name']
10418 [%| 'pattern shadows a name']
10324 =/ rest=(each (list term) @t) $(pats t.pats, seen [name seen])
10419 =/ rest=(each (list term) @t) $(pats t.pats, seen [name seen])
10325 ?: ?=(%| -.rest) rest
10420 ?: ?=(%| -.rest) rest
@@ -10861,6 +10956,9 @@
10861 ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
10956 ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
10862 =. gate-defs.state ~
10957 =. gate-defs.state ~
10863 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
10958 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
10959+ :: A ++ whose body is (unface |= …) is a gate too, unfaced
10960+ =/ peeled=(unit expr) (unfaced-gate val.d env state)
10961+ =? val.d ?=(^ peeled) u.peeled
10864 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
10962 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
10865 [%| ["recursive definition is not a gate" ~]]
10963 [%| ["recursive definition is not a gate" ~]]
10866 =/ result=(unit itype) (recursive-branch-seed d env state)
10964 =/ result=(unit itype) (recursive-branch-seed d env state)
@@ -10884,6 +10982,7 @@
10884 =/ product=itype ?~(result [%var id] u.result)
10982 =/ product=itype ?~(result [%var id] u.result)
10885 =/ st=istate state.p.sam(next +(id))
10983 =/ st=istate state.p.sam(next +(id))
10886 =/ seed=itype [%fn typ.p.sam product]
10984 =/ seed=itype [%fn typ.p.sam product]
10985+ =? seed ?=(^ peeled) (itype-unface seed sub.st)
10887 =/ seeded=ienv [[name.d [seed ~]] env.p.sam]
10986 =/ seeded=ienv [[name.d [seed ~]] env.p.sam]
10888 =/ body=expr
10987 =/ body=expr
10889 ?- -.gate
10988 ?- -.gate
@@ -10895,7 +10994,9 @@
10895 ?: ?=(%| -.out) out
10994 ?: ?=(%| -.out) out
10896 =/ uni=(unit isub) (itype-unify product typ.p.out sub.state.p.out)
10995 =/ uni=(unit isub) (itype-unify product typ.p.out sub.state.p.out)
10897 ?~ uni [%| ["recursive gate constraint is not supported by partial inference" ~]]
10996 ?~ uni [%| ["recursive gate constraint is not supported by partial inference" ~]]
10997+ =/ typ=itype [%fn typ.p.sam typ.p.out]
10998+ =? typ ?=(^ peeled) (itype-unface typ u.uni)
10898− [%& [%fn typ.p.sam typ.p.out] state.p.out(sub u.uni)]
10999+ [%& typ state.p.out(sub u.uni)]
10900++ dependency-root
11001++ dependency-root
10901 |= names=(list term)
11002 |= names=(list term)
@@ -11003,7 +11104,7 @@
11003:: Infer a cyclic component with one monomorphic seed per gate. All members
11104:: Infer a cyclic component with one monomorphic seed per gate. All members
11004:: must succeed before any scheme is available; pending constraints and
11105:: must succeed before any scheme is available; pending constraints and
11005:: unresolved branch joins remain partial.
11106:: unresolved branch joins remain partial.
11006−+$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps]
11107++$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps unfaced=?]
11007+$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
11108+$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
11008++ seed-gate-group
11109++ seed-gate-group
11009 |= [ds=(list def) env=ienv state=istate]
11110 |= [ds=(list def) env=ienv state=istate]
@@ -11011,7 +11112,9 @@
11011 ?~ ds [%& [~ state]]
11112 ?~ ds [%& [~ state]]
11012 =/ d=def i.ds
11113 =/ d=def i.ds
11013 ?. ?=(%value -.d) [%| ["recursive group contains a non-gate" ~]]
11114 ?. ?=(%value -.d) [%| ["recursive group contains a non-gate" ~]]
11115+ :: A ++ whose body is (unface |= …) is a gate too, unfaced
11116+ =/ peeled=(unit expr) (unfaced-gate val.d env state)
11014− =/ gate=expr val.d
11117+ =/ gate=expr ?~(peeled val.d u.peeled)
11015 ?. |(?=(%gate -.gate) ?=(%gate-wide -.gate))
11118 ?. |(?=(%gate -.gate) ?=(%gate-wide -.gate))
11016 [%| ["recursive group contains a non-gate" ~]]
11119 [%| ["recursive group contains a non-gate" ~]]
11017 =/ initial=istate (reserve-def-caps gate state)
11120 =/ initial=istate (reserve-def-caps gate state)
@@ -11029,7 +11132,8 @@
11031 =/ seed=itype [%fn typ.p.sam [%var next.state.p.sam]]
11134 =/ seed=itype [%fn typ.p.sam [%var next.state.p.sam]]
11135+ =? seed ?=(^ peeled) (itype-unface seed sub.state.p.sam)
11032− =/ entry=igate-entry [name.d seed body env.p.sam caps.state.p.sam]
11136+ =/ entry=igate-entry [name.d seed body env.p.sam caps.state.p.sam ?=(^ peeled)]
11033 =/ after=istate state.p.sam(next +(next.state.p.sam), caps caps.state)
11137 =/ after=istate state.p.sam(next +(next.state.p.sam), caps caps.state)
11034 =/ rest=igate-seeds $(ds t.ds, state after)
11138 =/ rest=igate-seeds $(ds t.ds, state after)
11035 ?: ?=(%| -.rest) rest
11139 ?: ?=(%| -.rest) rest
@@ -11069,6 +11173,7 @@
11069 ?: (constrained-capitals caps.entry sub.state)
11173 ?: (constrained-capitals caps.entry sub.state)
11070 [%| ["explicit capital constraints are not supported by partial inference" ~]]
11174 [%| ["explicit capital constraints are not supported by partial inference" ~]]
11071 =/ typ=itype (itype-normalize typ.entry sub.state)
11175 =/ typ=itype (itype-normalize typ.entry sub.state)
11176+ =? typ unfaced.entry (itype-unface typ ~)
11072 ?: (itype-has-nvar typ) [%| ["recursive group needs unsupported inference" ~]]
11177 ?: (itype-has-nvar typ) [%| ["recursive group needs unsupported inference" ~]]
11073 ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
11178 ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
11074 [%| ["recursive group needs unsupported inference" ~]]
11179 [%| ["recursive group needs unsupported inference" ~]]
@@ -12292,59 +12397,68 @@
12293 [n $(imports t.imports)]
12398 [n $(imports t.imports)]
12400+:: +reserved-name: whether n names a reserved operation
12402+:: proj and unface are handled by the checker by type, not bound, so
12403+:: no module may define, import or bind either name, as a value or
12404+:: as a mold. A field, tag or path segment may still be spelled so.
12295−++ reserved-proj-sample
12405+++ reserved-name
12408+ |(=(n %proj) =(n %unface))
12296 |= sam=sample
12410 |= sam=sample
12298 ?- -.sam
12412 ?- -.sam
12299− %bind =(name.sam %proj)
12413+ %bind (reserved-name name.sam)
12300− %face =(name.sam %proj)
12414+ %face (reserved-name name.sam)
12301− %pun =(name.sam %proj)
12415+ %pun (reserved-name name.sam)
12302− %cell (lien items.sam reserved-proj-sample)
12416+ %cell (lien items.sam reserved-sample)
12305−++ reserved-proj-pattern
12419+++ reserved-pattern
12306 |= p=pattern
12420 |= p=pattern
12309− %bind =(name.p %proj)
12423+ %bind (reserved-name name.p)
12310− %cell (lien items.p reserved-proj-pattern)
12424+ %cell (lien items.p reserved-pattern)
12313−++ reserved-proj-def
12427+++ reserved-def
12314 |= d=def
12428 |= d=def
12316− ?: =(name.d %proj) &
12430+ ?: (reserved-name name.d) &
12317− ?: ?=(%value -.d) (reserved-proj-expr val.d)
12431+ ?: ?=(%value -.d) (reserved-expr val.d)
12319−++ reserved-proj-expr
12433+++ reserved-expr
12320 |= e=expr
12434 |= e=expr
12323− %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
12437+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (reserved-expr p.p) |)))
12324− %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
12438+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (reserved-expr p.p) |)))
12325− %change (lien edits.e |=(p=edit (reserved-proj-expr val.p)))
12439+ %change (lien edits.e |=(p=edit (reserved-expr val.p)))
12326 %pair $(e val.e)
12440 %pair $(e val.e)
12327 %unit $(e val.e)
12441 %unit $(e val.e)
12328 %group $(e inner.e)
12442 %group $(e inner.e)
12329− %list (lien items.e reserved-proj-expr)
12443+ %list (lien items.e reserved-expr)
12330− %tuple (lien items.e |=(i=item (reserved-proj-expr val.i)))
12444+ %tuple (lien items.e |=(i=item (reserved-expr val.i)))
12331− ?(%gate %gate-wide) |((reserved-proj-sample sample.e) $(e body.e))
12445+ ?(%gate %gate-wide) |((reserved-sample sample.e) $(e body.e))
12332 %cast $(e val.e)
12446 %cast $(e val.e)
12333− %call |($(e head.e) (lien args.e reserved-proj-expr))
12447+ %call |($(e head.e) (lien args.e reserved-expr))
12334 %trace |($(e val.e) $(e then.e))
12448 %trace |($(e val.e) $(e then.e))
12335− %branch |($(e subject.e) (lien arms.e |=(a=arm |((reserved-proj-pattern pat.a) (reserved-proj-expr val.a)))))
12449+ %branch |($(e subject.e) (lien arms.e |=(a=arm |((reserved-pattern pat.a) (reserved-expr val.a)))))
12336− %body |((lien defs.e reserved-proj-def) $(e final.e))
12450+ %body |((lien defs.e reserved-def) $(e final.e))
12340−++ module-has-reserved-proj
12454+++ module-has-reserved
12341 |= mod=module
12455 |= mod=module
12343 =/ imported=(list term) (import-binding-names imports.mod)
12457 =/ imported=(list term) (import-binding-names imports.mod)
12344 =/ vals=(list term) (global-value-names defs.mod)
12458 =/ vals=(list term) (global-value-names defs.mod)
12345 =/ molds=imolds (collect-simple-molds defs.mod)
12459 =/ molds=imolds (collect-simple-molds defs.mod)
12346 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12460 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12347− |((lien (weld imported (weld vals mold-names)) |=(n=term =(n %proj))) (lien defs.mod reserved-proj-def))
12461+ |((lien (weld imported (weld vals mold-names)) reserved-name) (lien defs.mod reserved-def))
12349++ module-scope-valid
12463++ module-scope-valid
12350 |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
12464 |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
@@ -12353,7 +12467,7 @@
12353 =/ vals=(list term) (global-value-names defs.mod)
12467 =/ vals=(list term) (global-value-names defs.mod)
12354 =/ molds=imolds (collect-simple-molds defs.mod)
12468 =/ molds=imolds (collect-simple-molds defs.mod)
12355 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12469 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12356− ?: (module-has-reserved-proj mod) |
12470+ ?: (module-has-reserved mod) |
12357 ?. %+ levy imported
12471 ?. %+ levy imported
12358 |= n=term
12472 |= n=term
12359 &((unique-value-name n imported) !(lien vals |=(v=term =(n v))) !(lien mold-names |=(m=term =(n m))) !(lien prelude-values |=(v=term =(n v))) !(lien prelude-molds |=(m=term =(n m))))
12473 &((unique-value-name n imported) !(lien vals |=(v=term =(n v))) !(lien mold-names |=(m=term =(n m))) !(lien prelude-values |=(v=term =(n v))) !(lien prelude-molds |=(m=term =(n m))))
@@ -13042,7 +13156,7 @@
13043 =/ path-names=(list term) (turn paths |=(p=iapi-path name.p))
13157 =/ path-names=(list term) (turn paths |=(p=iapi-path name.p))
13044 =/ derived=(list term) (weld path-names poke-names)
13158 =/ derived=(list term) (weld path-names poke-names)
13045− ?: (lien derived |=(n=term =(n %proj))) |
13159+ ?: (lien derived reserved-name) |
13046 =/ outer=(list term) (weld prelude-values (weld (global-value-names defs.mod) (api-import-faces imports.mod)))
13160 =/ outer=(list term) (weld prelude-values (weld (global-value-names defs.mod) (api-import-faces imports.mod)))
13047 (levy derived |=(n=term &((unique-value-name n derived) !(lien outer |=(x=term =(n x))))))
13161 (levy derived |=(n=term &((unique-value-name n derived) !(lien outer |=(x=term =(n x))))))
@@ -13074,7 +13188,7 @@
13074 =/ clashes=(list term)
13188 =/ clashes=(list term)
13075 %+ skip names
13189 %+ skip names
13076 |= n=term
13190 |= n=term
13077− ?| =(n %proj)
13191+ ?| (reserved-name n)
13078 &((unique-value-name n names) !(lien outer |=(x=term =(n x))))
13192 &((unique-value-name n names) !(lien outer |=(x=term =(n x))))
13080 ?~ clashes ~
13194 ?~ clashes ~
@@ -13849,7 +13963,7 @@
13849 =/ action=term %poke
13963 =/ action=term %poke
13850 =/ ordinary=(list def) ds
13964 =/ ordinary=(list def) ds
13851 =/ derived=(list term) ~[%state action]
13965 =/ derived=(list term) ~[%state action]
13852− ?: (lien derived |=(n=term =(n %proj))) [%| ~]
13966+ ?: (lien derived reserved-name) [%| ~]
13853 =/ outer=(list term)
13967 =/ outer=(list term)
13854 (weld prelude-values (weld (global-value-names ordinary) (api-import-faces imports.mod)))
13968 (weld prelude-values (weld (global-value-names ordinary) (api-import-faces imports.mod)))
13855 =/ clashes=(list term)
13969 =/ clashes=(list term)
@@ -15619,8 +15733,8 @@
15619 ?: ?=(%| -.parsed) (show-error src p.parsed)
15733 ?: ?=(%| -.parsed) (show-error src p.parsed)
15620 =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
15734 =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
15621 ?^ duplicate (duplicate-fields-report file src u.duplicate)
15735 ?^ duplicate (duplicate-fields-report file src u.duplicate)
15622− ?: (module-has-reserved-proj p.parsed)
15736+ ?: (module-has-reserved p.parsed)
15623− 'module has reserved proj name'
15737+ 'module has a reserved proj or unface name'
15624 =/ ds=(list def) defs.p.parsed
15738 =/ ds=(list def) defs.p.parsed
15625 =/ molds=imolds (collect-simple-molds ds)
15739 =/ molds=imolds (collect-simple-molds ds)
15626 =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
15740 =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
@@ -15698,7 +15812,7 @@
15698 =. head-evidence.initial heads
15812 =. head-evidence.initial heads
15699 =. initial (reserve-def-caps val.d initial)
15813 =. initial (reserve-def-caps val.d initial)
15700 =/ result=iresult
15814 =/ result=iresult
15701− ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
15815+ ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d) ?=(^ (unfaced-gate val.d env initial)))
15702 (infer-recursive-gate d env initial)
15816 (infer-recursive-gate d env initial)
15703 (infer-fragment val.d env initial)
15817 (infer-fragment val.d env initial)
15704 ?: ?=(%| -.result)
15818 ?: ?=(%| -.result)