Skip to content

variable

pannous edited this page Feb 16, 2021 · 7 revisions

A scoped variable is a key in the current object map. There are subtle differences between constant variable declarations and mutating variable assignments. In a creating constructor scope, symbols are assumed to be newly defined:

{a:3}

Here a is freshly created. If it exists in an outer scope

{
 a:4
 b:{a:5}
}

these two instances of symbol 'a' exist independently side-by-side. they can naturally be accessed by it.a (==4) and it.b.a (==5)

sub scopes have access to parent variables:

{
 c:4
 b:{a:c}
}
it.b.a==4
it.b.c==4

ideally future IDEs offer support for different layout of those inherited properties in auto completion: integrate parent properties alphabetically or separate by degree of inheritance.

cross-referencing from neighbor scope

sometimes it is desirable to access variables which are not directly in the parent scope:

{
 colors:{red:(1 0 0) green:(0 1 0)}
 circle:{radius:5 color:red}
}

color:red is unambivalent if there are no other occurrences of red, however it might be necessary to specify the exact reference via path or making it global via ID. todo Each subpath acts as a pattern for the current scope:

{
 colors:{red:(1 0 0) green:(0 1 0)}
 circle:{radius:5 color: colors.red}
}

Here colors.red can be understood

  • in an object oriented way (accessing the property red of the variable colors)
  • as an enum colors with value red
  • as a reference path for the parent scopes
  • in an agnostic way

Home

Philosophy •

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally