A literal is defined as fixed values embedded in the source code. Also known as self-evaluating expressions.
69 420 ;; regular decimal literals
;; 042 ;; ERROR! Leading zeroes not allowed
0b0 0b01000101 ;; regular binary literals
0o0 0o377 ;; regular octal literals
0x69 0xbeef ;; regular hexadecimal literals
1'004 ;; decimal literal with separator
0b0010'0100 ;; binary literal with separator
0xb0'0b ;; hexadecimal literal with separatorA number literal is of integer type.
A string is a contained sequence of bytes in the source code that is converted into data that is embedded in the final program.
'' 'i am data?' ;; regular string literals
"" "i\'m data?" ;; escapable string literals
A string literal is of array of byte type.
Sometimes, it’s convenient to get a number representation of a byte in the source code (i.e. 0 or a). Mostly for ASCII math stuff, to be honest, but still needed often enough to be necessary.
`6` `9` `A` ;; regular byte literals
;; `` ;; ERROR! Empty byte literal
Byte literals accept basic escaped values like \n for newline, \0 for NUL, and \\ for \.
There are two of them.
true
false
A way to write a literal of more complex types (like structs).
Just a list of expressions separated by soft separators, with the extra ability to name expressions.
;; regular compound literals
!{}; !{420}; !{420, 69};
;; compound literal with named expressions
!{.value 420}; !{.x 420, .y 69};