You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would employ a new format of the form: let x <- f₁; f₂, which allows a format to be parsed, with the result added to the environment, and then a subsequent format will be parsed in that environment. This would result in a data structure that looks something like:
The typing and parsing rules for this format could look something like:
f₁ : Format x : Repr f₁ ⊢ f₂ : Format
──────────────────────────────────────────────
let x <- f₁; f₂ : Format
s .. s' : f₁ ⟹ e₁ x : Repr f = e₁ ⊢ s' .. s'' : f₁ ⟹ e₂
────────────────────────────────────────────────────────────────
s .. s'' : (let x <- f₁; f₂) ⟹ e₂
Alas, difficulty arises when attempting to define a host representation for this format.
Repr (let x <- f₁; f₂ x) = Repr (f₂ x)
^ where is `x : Repr f₁` bound?
I'm not sure yet how to resolve this.
I also have suspicions that this could also make a implementing a dual binary semantics more challenging, but we’ll likely also struggle with this for link and deref types.
The text was updated successfully, but these errors were encountered:
No, this is a bit different… here we bind the result of some parsed data but then don’t add a corresponding field in the representation type. I’m not sure if that really makes sense or is a good idea or not! The computed fields in #371 allow you to add a constant in the middle of a record format and do show up in the representation type. I realise this is confusing though (and the confusion might show there’s an issue with the design).
In the OpenType we sometimes have to employ records as a way to store intermediate values during parsing. For example:
This is not ideal as this results in a copy of
hhea
andmaxp
appearing in the resulting data structures after parsing. For example:It would be nice however to be able to write something like:
This would employ a new format of the form:
let x <- f₁; f₂
, which allows a format to be parsed, with the result added to the environment, and then a subsequent format will be parsed in that environment. This would result in a data structure that looks something like:This also has the tantalizing possibility of being further improved to look something like:
Rough Specification
The typing and parsing rules for this format could look something like:
Alas, difficulty arises when attempting to define a host representation for this format.
I'm not sure yet how to resolve this.
I also have suspicions that this could also make a implementing a dual binary semantics more challenging, but we’ll likely also struggle with this for
link
andderef
types.The text was updated successfully, but these errors were encountered: