-
Notifications
You must be signed in to change notification settings - Fork 46
Syntax
Sherlock9 edited this page Dec 31, 2016
·
12 revisions
From the Tutorial:
Jelly uses its own 256-byte code page. Most of the characters in it are allocated for built-in atoms, but some of them have special semantics.
For now, this is just a list of Jelly syntax characters. An explanation will be added later.
Literal digits together are not added individually, but as a single number. 23
is the nilad 23. Use spaces to separate tokens 2 3
for 2, then 3.
Symbol | Description |
---|---|
|
Token separator. |
0 |
The literal 0. |
1 |
The literal 1. |
2 |
The literal 2. |
3 |
The literal 3. |
4 |
The literal 4. |
5 |
The literal 5. |
6 |
The literal 6. |
7 |
The literal 7. |
8 |
The literal 8. |
9 |
The literal 9. |
The following is a simple description of string literals. A more complete description can be found in the tutorial.
Symbol | Description | Syntax |
---|---|---|
“ |
Begins a string literal, and separates a list of strings inside a string literal. | “12“34” |
” |
Terminates a regular string or a list of strings. Without “ , a character literal. |
“1234” |
» |
Terminates a dictionary-compressed string. | “1234» |
‘ |
Terminates a code-page index list. Jelly's version of ord() . |
“12“34‘ |
’ |
Terminates a base-250 number. | “1234’ |
Symbol | Description | Syntax |
---|---|---|
<newline> |
Starts a new link | <link><newline><line> |
ø |
Starts a separate niladic chain. | ø<link> |
µ |
Starts a separate monadic chain. | µ<link> |
ð |
Starts a separate dyadic chain. | ð<link> |
ı |
Complex number. Without arguments, 1j . |
xıy |
ȷ |
Decimal number, as in 2e6 for 2000000 . Without arguments, 1000 . |
xȷy |
- |
Negative number. Without arguments, -1 . |
-5 |
. |
Decimal number. Without arguments, 0.5 . |
1.2 |
[ |
Begins a list. | [2] |
] |
Ends a list. | [2] |