||Any input is ignored.|
||The output is the value read from the variable.||
||The name of the variable.||
||The key of the value to read from the table (parameter applicable only if the target variable is a table).||
||If the variable is available to all of the wires in the same mesh.||
||The default value to use to infer types and output if the variable is not set, key is not there and/or type mismatches.||
Reads the value of the variable passed to it.
Getis used read the value of an existing variable. All sorts of variables that can be created by
Set, can be read by
:Name parameter should contain the name of the variable that's being read. If the variable is a string/numeric variable or a sequence it will be read directly. But for a table to be read its key should be passed in the parameter
:Key. This will allow
Get to access the particular key in the table and read it's value.
:Default parameter specifies a value to return in case the variable being read doesn't yeild a valid value, or the sequence is malformed, or the required key is missing from the table, etc. This allows the program to continue processing even if some expected data is missing.
Since variables may be locally scoped (created with
(:Global false); exists only for current wire) or globally scoped (created with
(:Global true); exists for all wires of that mesh), both parameters
:Name are used in combination to identify the correct variable to read.
Any input to this shard is ignored and its output contains the value of the variable read by
Get has an alias
??. This symbol represents the logical operator
?? functions as an alias for
Get with a default value. For example,
.var1 ?? 40 means
.var1 or 40 and this is effectively an alias for
(Get .var1 :Default 40). See the code examples at the end to understand how this alias is used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
[info] Set - Warning: setting an already exposed variable "str", use Update to avoid this warning. [info] [shards/General/Get/Get.edn] gotten value: Hello [info] [shards/General/Get/Get.edn] gotten value: 100 [info] [shards/General/Get/Get.edn] [10 20 30] [warning] Get found a variable but it's using the default value because the type found did not match with the default type. [info] [shards/General/Get/Get.edn] Void [info] [shards/General/Get/Get.edn] [a b] [info] [shards/General/Get/Get.edn] Key missing [info] [shards/General/Get/Get.edn] Key still missing [info] [shards/General/Get/Get.edn] Local [info] [shards/General/Get/Get.edn] Global