Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove deprecated operators

...

Persistent variables cannot appear on the left-hand side of a declaration in the prelude. 

...

For historical reasons, if the persistent variable does not exist before it is used, the default value is 0. 

...

Examples

The following declaration would add 3 to the value stored in the entity counter ent:fizz, storing the result in x:

Confluence
Code Block
theme
languagejavascript
pre {
  x = ent:fizz + 3
}

Deprecated Operators

Info
titleDeprecated

The following are deprecated and should not be used. 

KRL includes special built-in functions for accessing individual places in a trail. These are deprecated and should not be used

  • history. This takes an expression and a persistent variable as arguments. If the expression evaluates to n, then the history function will return the nth place on the trail. The most recent place is at history location 0. If n is larger than the length of the trail, the history function returns the empty string. 
code
language
themeConfluencejavascript
pre {
  x = history 1 ent:another_trail;
}
  • current. This takes a persistent variable as its argument. The current function performs the same operation as the history function with a location of 0. That is, it returns the most recent place on the trail.
Code Block
themeConfluence
languagejavascript
pre {
  x = current ent:another_trail;fizz + 3
}