-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: Model the bindings of a declarative Env Rec as a List of Records #2288
base: main
Are you sure you want to change the base?
Conversation
Some alternatives for DeclarativeBindingRecord: (1) (2) (2a) (2b) [Later: I went with 2b, basically.] |
81b6a51
to
894539c
Compare
(forced-pushed after rebase to master) |
894539c
to
fe7b168
Compare
(force-pushed to resolve merge conflicts) |
3d0c24c
to
7a79833
Compare
f958ce0
to
c48c4f0
Compare
c48c4f0
to
5841268
Compare
5841268
to
097ae97
Compare
237c68d
to
03eeaf8
Compare
03eeaf8
to
05b931b
Compare
05b931b
to
47fddef
Compare
47fddef
to
7d473b2
Compare
Okay, this PR is ready for review. Issue #2639 might affect SetMutableBinding, but probably not much. |
7d473b2
to
af9acc5
Compare
af9acc5
to
15b7e06
Compare
15b7e06
to
7a256c1
Compare
7a256c1
to
3bb7239
Compare
3bb7239
to
ac458e8
Compare
ac458e8
to
e023ad5
Compare
e023ad5
to
475dc26
Compare
spec.html
Outdated
</table> | ||
</emu-table> | ||
|
||
<p>A <dfn>DeclarativeBinding</dfn> is either a SimpleDeclarativeBinding or an ImportDeclarativeBinding. SimpleDeclarativeBindings can appear in any Declarative Environment Record, but ImportDeclarativeBindings can only appear in a Module Environment Record.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>A <dfn>DeclarativeBinding</dfn> is either a SimpleDeclarativeBinding or an ImportDeclarativeBinding. SimpleDeclarativeBindings can appear in any Declarative Environment Record, but ImportDeclarativeBindings can only appear in a Module Environment Record.</p> | |
<p>A <dfn variants="DeclarativeBindings">DeclarativeBinding</dfn> is either a SimpleDeclarativeBinding or an ImportDeclarativeBinding. SimpleDeclarativeBindings can appear in any Declarative Environment Record, but ImportDeclarativeBindings can only appear in a Module Environment Record.</p> |
Same for SimpleDeclarativeBinding
and ImportDeclarativeBinding
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
spec.html
Outdated
<th>Meaning</th> | ||
</tr> | ||
<tr> | ||
<td>[[BoundName]]</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field needs to be moved to the description of DeclarativeBinding
since we refer to it on values that are known only to be a DeclarativeBinding
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying it needs to be that way in order for the spec to be "correct" in some sense? Because it sounds like you're talking about statically typing the pseudocode, and you have in mind a specific rule for how that should work.
As a counter-example, consider ComposeWriteEventBytes
, which has _W_.[[ByteIndex]]
, where _W_
is either a WriteSharedMemory event or a ReadModifyWriteSharedMemory event, each of which separately declares a [[ByteIndex]]
field. There are several other such examples.
spec.html
Outdated
1. <emu-not-ref>Record</emu-not-ref> that the binding for _N_ in _envRec_ has been initialized. | ||
1. Assert: _envRec_.HasBinding(_N_) is *true*. | ||
1. Let _binding_ be the DeclarativeBinding in _envRec_.[[Bindings]] whose [[BoundName]] field equals _N_. | ||
1. Assert: _binding_ is a SimpleDeclarativeBinding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just say SimpleDeclarativeBinding
in place of DeclarativeBinding
in the above step then?
edit: Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the spec does that.
That is, in a phrase like:
the [thing] in [some list] that satisfies [some constraint]
I don't think the [thing]
phrase is ever restrictive. Rather, it's a descriptor that's true of every element of [some list]
. All the restriction happens in [some constraint]
.
475dc26
to
7664b2d
Compare
... in other Declarative Env Rec methods.
... that has a distinct existence from its env rec.
... that is a List of bindings (without being specific yet about what a binding is).
7664b2d
to
ade059f
Compare
Making this a draft PR because I'm not sure about module Env Recs.