Named contexts
A context may carry an optional name: an identifier attached to it.
Today a name acts as a label. Its most common use is inside a
pick, whose alternatives are listed
inline — a name distinguishes those alternatives from one another when
several contexts may apply at a given point in execution.
Names are opaque strings; the format imposes no structure on them. A name is meant to be unique within a program so it can identify a context, but the format does not yet define any way to reference a context by its name — so a declared name is currently inert, a label only.
Naming a context is groundwork: establishing the identifier now lets a
future name-based pick selection reference an alternative by its name
instead of listing it inline. Compilers should choose names that are
meaningful to debugger users.
- Explore
- View source
- Playground
- YAML
- JSON
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "schema:ethdebug/format/program/context/name"
title: ethdebug/format/program/context/name
description: |
An optional identifier attached to a context.
Today a `name` acts as a label. It is most useful inside a
`pick`, whose alternatives are listed inline: a name distinguishes
those alternatives from one another when several contexts may apply
at a point in execution.
Names are opaque strings; the format imposes no structure on them.
A name is meant to be unique within a program so it can identify a
context, but the format does **not** yet define any way to
reference a context by its name — so a declared name is currently
inert, a label only.
It is groundwork: establishing the identifier now lets a future
name-based `pick` selection reference an alternative by its name
instead of listing it inline. Compilers **should** choose names
that are meaningful to debugger users.
type: object
properties:
name:
type: string
required:
- name
examples:
# example: distinguishing a `pick` alternative
- name: "storage-layout-v2"
# example: naming a generic instantiation
- name: "Array<T=bytes32>"
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema:ethdebug/format/program/context/name",
"title": "ethdebug/format/program/context/name",
"description": "An optional identifier attached to a context.\n\nToday a `name` acts as a label. It is most useful inside a\n`pick`, whose alternatives are listed inline: a name distinguishes\nthose alternatives from one another when several contexts may apply\nat a point in execution.\n\nNames are opaque strings; the format imposes no structure on them.\nA name is meant to be unique within a program so it can identify a\ncontext, but the format does **not** yet define any way to\nreference a context by its name — so a declared name is currently\ninert, a label only.\n\nIt is groundwork: establishing the identifier now lets a future\nname-based `pick` selection reference an alternative by its name\ninstead of listing it inline. Compilers **should** choose names\nthat are meaningful to debugger users.\n",
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"examples": [
{
"name": "storage-layout-v2"
},
{
"name": "Array<T=bytes32>"
}
]
}