In most lists, the first item is an operator . Stardust
calculates the arguments first. Then it applies the operator to them. The names
on this page control which arguments Stardust calculates or give a value.
An expression produces a value. A literal expression, such as 5, adult or
true, produces itself. A variable expression starts with ? and reads a named
value.
TRON371 B
Offset (hex) Bytes (hex) Meaning 000 54 52 4F 4E magic TRON 004 3C 616765 txt "age" 008 02 24000000000000
00 i64 36 011 0F 0A 04000000 0800
0000 map leaf, size 10: @4 → @8 01B 4C 726F6C65 txt "role" 020 8C 656E67696E6565
72 txt "engineer" 029 0F 0A 1B000000 2000
0000 map leaf, size 10: @1B → @20 033 4C 6E616D65 txt "name" 038 3C 416461 txt "Ada" 03C 0F 0A 33000000 3800
0000 map leaf, size 10: @33 → @38 046 07 12 00910000 1100
0000 29000000 3C00
0000 map branch, size 18, depth 0 (root), slots 8, 12, 15: @11 → @29 → @3C 058 5C 236C696E6B txt "#link" 05E 5C 235F616461 txt "#_ada" 064 0F 0A 58000000 5E00
0000 map leaf, size 10: @58 → @5E 06E 3C 616765 txt "age" 072 02 29000000000000
00 i64 41 07B 0F 0A 6E000000 7200
0000 map leaf, size 10: @6E → @72 085 6C 6D656E746F72 txt "mentor" 08C 0F 0A 85000000 6400
0000 map leaf, size 10: @85 → @64 096 4C 726F6C65 txt "role" 09B 8C 656E67696E6565
72 txt "engineer" 0A4 0F 0A 96000000 9B00
0000 map leaf, size 10: @96 → @9B 0AE 4C 6E616D65 txt "name" 0B3 3C 426F62 txt "Bob" 0B7 0F 0A AE000000 B300
0000 map leaf, size 10: @AE → @B3 0C1 07 16 00990000 7B00
0000 8C000000 A400
0000 B7000000 map branch, size 22, depth 0 (root), slots 8, 11, 12, 15: @7B → @8C → @A4 → @B7 0D7 3C 616765 txt "age" 0DB 02 1D000000000000
00 i64 29 0E4 0F 0A D7000000 DB00
0000 map leaf, size 10: @D7 → @DB 0EE 4C 726F6C65 txt "role" 0F3 8C 64657369676E65
72 txt "designer" 0FC 0F 0A EE000000 F300
0000 map leaf, size 10: @EE → @F3 106 4C 6E616D65 txt "name" 10B 2C 4379 txt "Cy" 10E 0F 0A 06010000 0B01
0000 map leaf, size 10: @106 → @10B 118 07 12 00910000 E400
0000 FC000000 0E01
0000 map branch, size 18, depth 0 (root), slots 8, 12, 15: @E4 → @FC → @10E 12A 4C 235F6379 txt "#_cy" 12F 0F 0A 2A010000 1801
0000 map leaf, size 10: @12A → @118 139 5C 235F626F62 txt "#_bob" 13F 0F 0A 39010000 C100
0000 map leaf, size 10: @139 → @C1 149 5C 235F616461 txt "#_ada" 14F 0F 0A 49010000 4600
0000 map leaf, size 10: @149 → @46 159 07 12 80210000 2F01
0000 3F010000 4F01
0000 map branch, size 18, depth 0 (root), slots 7, 8, 13: @12F → @13F → @14F
if has a condition, a result for true, and an optional result for false. Only
null and false are false. Stardust calculates only the branch that it uses.
Without the last argument, a false condition gives null.
TRON89 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 3E txt ">" 06 4C 3F616765 txt "?age" 0B 02 12000000000000
00 i64 18 14 0E 15 00 0700 030000
00 04000000 060000
00 0B000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @6 → @B 29 2C 6966 txt "if" 2C 5C 6164756C74 txt "adult" 32 5C 6D696E6F72 txt "minor" 38 0E 19 00 0F00 040000
00 29000000 140000
00 2C000000 320000
00 array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @29 → @14 → @2C → @32
TRON18 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 5C 6164756C74 txt "adult"
when and unless each have a condition and one result. when gives the
result when the condition is true.
TRON81 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 3E txt ">" 06 4C 3F616765 txt "?age" 0B 02 12000000000000
00 i64 18 14 0E 15 00 0700 030000
00 04000000 060000
00 0B000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @6 → @B 29 4C 7768656E txt "when" 2E 5C 6164756C74 txt "adult" 34 0E 15 00 0700 030000
00 29000000 140000
00 2E000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @29 → @14 → @2E
TRON18 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 5C 6164756C74 txt "adult"
unless gives the result when the condition is false.
TRON54 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 6C 756E6C657373 txt "unless" 0B 8C 3F626C6F636B65
64 txt "?blocked" 14 4C 73656E64 txt "send" 19 0E 15 00 0700 030000
00 04000000 0B0000
00 14000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @B → @14
TRON17 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 4C 73656E64 txt "send"
In the other case, each one gives null. Neither operator accepts a second
result.
cond has pairs of condition and result. It gives the result of the first true
condition.
TRON148 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 3C txt "<" 06 2C 3F6E txt "?n" 09 02 00000000000000
00 i64 0 12 0E 15 00 0700 030000
00 04000000 060000
00 09000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @6 → @9 27 1C 3D txt "=" 29 2C 3F6E txt "?n" 2C 02 00000000000000
00 i64 0 35 0E 15 00 0700 030000
00 27000000 290000
00 2C000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @27 → @29 → @2C 4A 4C 636F6E64 txt "cond" 4F 8C 6E656761746976
65 txt "negative" 58 4C 7A65726F txt "zero" 5D 09 bit true 5E 8C 706F7369746976
65 txt "positive" 67 0E 25 00 7F00 070000
00 4A000000 120000
00 4F000000 350000
00 58000000 5D0000
00 5E000000 array leaf, size 37, shift 0, bitmap 007F, count 7 (root): @4A → @12 → @4F → @35 → @58 → @5D → @5E
TRON21 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 8C 706F7369746976
65 txt "positive"
and and or stop at the first argument that sets the answer. Both give
true or false.
let sets variables for the rest of the expression. Variable names and values
come in pairs. Each binding and reference uses ?name, and each value can read
the variables above it.
TRON141 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 2B txt "+" 06 2C 3F61 txt "?a" 09 02 01000000000000
00 i64 1 12 0E 15 00 0700 030000
00 04000000 060000
00 09000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @6 → @9 27 2C 3F61 txt "?a" 2A 02 05000000000000
00 i64 5 33 2C 3F62 txt "?b" 36 0E 19 00 0F00 040000
00 27000000 2A0000
00 33000000 120000
00 array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @27 → @2A → @33 → @12 4F 1C 2A txt "*" 51 2C 3F61 txt "?a" 54 2C 3F62 txt "?b" 57 0E 15 00 0700 030000
00 4F000000 510000
00 54000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4F → @51 → @54 6C 3C 6C6574 txt "let" 70 0E 15 00 0700 030000
00 6C000000 360000
00 57000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @6C → @36 → @57
TRON21 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 02 1E000000000000
00 i64 30
The same spelling declares and reads a variable. If let or fn does not
declare the variable, the caller must give its value. A local declaration with
the name of a caller variable replaces that variable for the rest of the
expression.
TRON101 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 2C 3F78 txt "?x" 07 02 02000000000000
00 i64 2 10 0E 11 00 0300 020000
00 04000000 070000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @7 21 1C 2B txt "+" 23 2C 3F78 txt "?x" 26 02 01000000000000
00 i64 1 2F 0E 15 00 0700 030000
00 21000000 230000
00 26000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @21 → @23 → @26 44 3C 6C6574 txt "let" 48 0E 15 00 0700 030000
00 44000000 100000
00 2F000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @44 → @10 → @2F
TRON21 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 02 03000000000000
00 i64 3
A plain word in value position stays text.
TRON106 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 5C 3F6E616D65 txt "?name" 0A 02 07000000000000
00 i64 7 13 0E 11 00 0300 020000
00 04000000 0A0000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @A 24 4C 6C697374 txt "list" 29 4C 6E616D65 txt "name" 2E 5C 3F6E616D65 txt "?name" 34 0E 15 00 0700 030000
00 24000000 290000
00 2E000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @24 → @29 → @2E 49 3C 6C6574 txt "let" 4D 0E 15 00 0700 030000
00 49000000 130000
00 34000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @49 → @13 → @34
TRON43 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 4C 6E616D65 txt "name" 09 02 07000000000000
00 i64 7 12 0E 11 00 0300 020000
00 04000000 090000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @9
fn makes a function. It has a list of parameter names and a body. Some
operators use a function directly.
TRON164 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 6C 3F76616C7565 txt "?value" 0B 0E 0D 00 0100 010000
00 04000000 array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 18 1C 2A txt "*" 1A 6C 3F76616C7565 txt "?value" 21 02 02000000000000
00 i64 2 2A 0E 15 00 0700 030000
00 18000000 1A0000
00 21000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @18 → @1A → @21 3F 2C 666E txt "fn" 42 0E 15 00 0700 030000
00 3F000000 0B0000
00 2A000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3F → @B → @2A 57 4C 6C697374 txt "list" 5C 02 01000000000000
00 i64 1 65 02 02000000000000
00 i64 2 6E 0E 15 00 0700 030000
00 57000000 5C0000
00 65000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @57 → @5C → @65 83 3C 6D6170 txt "map" 87 0E 15 00 0700 030000
00 83000000 420000
00 6E000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @83 → @42 → @6E
TRON47 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 02 02000000000000
00 i64 2 0D 02 04000000000000
00 i64 4 16 0E 11 00 0300 020000
00 04000000 0D0000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @D
Each parameter uses ?name to declare a variable. The
parameter names must be different from each other. A reference in the function
body starts with ?. A function has a maximum of eight parameters. The body can
also use each variable from a let around it.
You can also give a function a name with let. Put its variable reference first
in a list. Stardust then calculates the function with the other items as its
arguments.
TRON179 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 6C 3F76616C7565 txt "?value" 0B 0E 0D 00 0100 010000
00 04000000 array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 18 1C 2A txt "*" 1A 6C 3F76616C7565 txt "?value" 21 02 02000000000000
00 i64 2 2A 0E 15 00 0700 030000
00 18000000 1A0000
00 21000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @18 → @1A → @21 3F 2C 666E txt "fn" 42 0E 15 00 0700 030000
00 3F000000 0B0000
00 2A000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3F → @B → @2A 57 7C 3F646F75626C65 txt "?double" 5F 0E 11 00 0300 020000
00 57000000 420000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @57 → @42 70 7C 3F646F75626C65 txt "?double" 78 02 03000000000000
00 i64 3 81 0E 11 00 0300 020000
00 70000000 780000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @70 → @78 92 3C 6C6574 txt "let" 96 0E 15 00 0700 030000
00 92000000 5F0000
00 81000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @92 → @5F → @81
TRON21 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 02 06000000000000
00 i64 6
list makes a list. Stardust calculates each item, then keeps the results in
order. The empty list is [].
TRON101 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 2B txt "+" 06 02 01000000000000
00 i64 1 0F 02 02000000000000
00 i64 2 18 0E 15 00 0700 030000
00 04000000 060000
00 0F000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @6 → @F 2D 4C 6C697374 txt "list" 32 02 01000000000000
00 i64 1 3B 02 02000000000000
00 i64 2 44 0E 19 00 0F00 040000
00 2D000000 320000
00 3B000000 180000
00 array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @2D → @32 → @3B → @18
TRON60 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 02 01000000000000
00 i64 1 0D 02 02000000000000
00 i64 2 16 02 03000000000000
00 i64 3 1F 0E 15 00 0700 030000
00 04000000 0D0000
00 16000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @D → @16
A map is an ordinary document. Stardust calculates each value in it and keeps
each name.
TRON100 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 2B txt "+" 06 02 01000000000000
00 i64 1 0F 02 01000000000000
00 i64 1 18 0E 15 00 0700 030000
00 04000000 060000
00 0F000000 array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @4 → @6 → @F 2D 1C 61 txt "a" 2F 02 01000000000000
00 i64 1 38 0F 0A 2D000000 2F00
0000 map leaf, size 10: @2D → @2F 42 1C 62 txt "b" 44 0F 0A 42000000 1800
0000 map leaf, size 10: @42 → @18 4E 07 0E 40800000 3800
0000 44000000 map branch, size 14, depth 0 (root), slots 6, 15: @38 → @44
TRON68 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 1C 61 txt "a" 06 02 01000000000000
00 i64 1 0F 0F 0A 04000000 0600
0000 map leaf, size 10: @4 → @6 19 1C 62 txt "b" 1B 02 02000000000000
00 i64 2 24 0F 0A 19000000 1B00
0000 map leaf, size 10: @19 → @1B 2E 07 0E 40800000 0F00
0000 24000000 map branch, size 14, depth 0 (root), slots 6, 15: @F → @24
Text, numbers, true, false and null are values. Stardust gives each one
without a change. A list whose first item is not text is also a list of values.
list makes this clear to the reader.
Some other languages use quote to stop the evaluation of a list. Stardust
reserves the name and rejects it. A plain word is already text, so a program
needs no operator for this.
TRON37 B
Offset (hex) Bytes (hex) Meaning 00 54 52 4F 4E magic TRON 04 5C 71756F7465 txt "quote" 0A 1C 61 txt "a" 0C 0E 11 00 0300 020000
00 04000000 0A0000
00 array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @A
Error
Unsupported_Node: quote is not supported yet
build · program evaluate .