"Evaluate an expression and store it in a local variable.\n",
"\n",
"\n",
"Variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name."
"The expression is evaluated only once, in the current state, and its value is stored. Once set, variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.\n",
"\n",
"**Note:** The values of local variables are currently stored in text form. Values must have a syntactically valid text representation, and large values may cause performance issues."
],
],
"text/plain": [
"text/plain": [
"```\n",
":let NAME EXPR\n",
":let NAME VALUE\n",
"Evaluate an expression and store it in a local variable.\n",
"```\n",
"\n",
"\n",
"Set the value of a local variable.\n",
"The expression is evaluated only once, in the current state, and its value is stored. Once set, variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.\n",
"\n",
"\n",
"Variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name."
"**Note:** The values of local variables are currently stored in text form. Values must have a syntactically valid text representation, and large values may cause performance issues."
]
]
},
},
"execution_count": 1,
"execution_count": 1,
...
@@ -50,10 +51,7 @@
...
@@ -50,10 +51,7 @@
"Remove a local variable."
"Remove a local variable."
],
],
"text/plain": [
"text/plain": [
"```\n",
":unlet NAME\n",
":unlet NAME\n",
"```\n",
"\n",
"Remove a local variable."
"Remove a local variable."
]
]
},
},
...
@@ -70,7 +68,21 @@
...
@@ -70,7 +68,21 @@
"cell_type": "code",
"cell_type": "code",
"execution_count": 3,
"execution_count": 3,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"$\\{1,2,3,4,5,10\\}$"
],
"text/plain": [
"{1,2,3,4,5,10}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"source": [
":let hello 1..5 \\/ {10}"
":let hello 1..5 \\/ {10}"
]
]
...
@@ -102,7 +114,21 @@
...
@@ -102,7 +114,21 @@
"cell_type": "code",
"cell_type": "code",
"execution_count": 5,
"execution_count": 5,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"$2$"
],
"text/plain": [
"2"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"source": [
":let n 2"
":let n 2"
]
]
...
...
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
:help :let
:help :let
```
```
%% Output
%% Output
```
```
:let NAME VALUE
:let NAME EXPR
```
```
Set the value of a local variable.
Evaluate an expression and store it in a local variable.
Variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.
The expression is evaluated only once, in the current state, and its value is stored. Once set, variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.
```
:let NAME VALUE
```
Set the value of a local variable.
**Note:** The values of local variables are currently stored in text form. Values must have a syntactically valid text representation, and large values may cause performance issues.
:let NAME EXPR
Evaluate an expression and store it in a local variable.
Variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.
The expression is evaluated only once, in the current state, and its value is stored. Once set, variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.
**Note:** The values of local variables are currently stored in text form. Values must have a syntactically valid text representation, and large values may cause performance issues.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
:help :unlet
:help :unlet
```
```
%% Output
%% Output
```
```
:unlet NAME
:unlet NAME
```
```
Remove a local variable.
Remove a local variable.
```
:unlet NAME
:unlet NAME
```
Remove a local variable.
Remove a local variable.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
:let hello 1..5 \/ {10}
:let hello 1..5 \/ {10}
```
```
%% Output
$\{1,2,3,4,5,10\}$
{1,2,3,4,5,10}
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
hello
hello
```
```
%% Output
%% Output
$\{1,2,3,4,5,10\}$
$\{1,2,3,4,5,10\}$
{1,2,3,4,5,10}
{1,2,3,4,5,10}
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
:let n 2
:let n 2
```
```
%% Output
$2$
2
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
n
n
```
```
%% Output
%% Output
$2$
$2$
2
2
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
{x | x : hello & x mod n = 0}
{x | x : hello & x mod n = 0}
```
```
%% Output
%% Output
$\{2,4,10\}$
$\{2,4,10\}$
{2,4,10}
{2,4,10}
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
:unlet n
:unlet n
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` prob
``` prob
n
n
```
```
%% Output
%% Output
:eval: Computation not completed: Unknown identifier "n", the possible completion is "not"
:eval: Computation not completed: Unknown identifier "n", the possible completion is "not"
return"Evaluate an expression and store it in a local variable.";
}
}
@Override
@Override
public@NotNullStringgetHelpBody(){
public@NotNullStringgetHelpBody(){
return"Variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.\n\n**Note:** Local variables are currently stored in text form. Values must have a syntactically valid text representation, and large values may cause performance issues.";
return"The expression is evaluated only once, in the current state, and its value is stored. Once set, variables are available in all states and are not affected by machine loads. A variable created by `:let` shadows any identifier from the machine with the same name.\n\n**Note:** The values of local variables are currently stored in text form. Values must have a syntactically valid text representation, and large values may cause performance issues.";