Literals: Dak Tour
Tour Index
Eval
Pretty
Raw
Minify
; Dak supports various literals and mostly behaves ; the same as JavaScript. ; Numbers are as you would expect. (prn 42) (prn 4.2) (prn 0o1234) (prn 0x1234) (prn 0b1010) (prn 1n) (prn 3.1415926) (prn .123456789) (prn 3.1E+12) (prn .1e-23) ; Strings are always double quoted, and allow for ; literal newlines. Escapes also work as usual. (prn "hello world") (prn "hello\nworld") (prn "hello world") (prn "\uD83D\uDE00") ; Keywords are a shorthand for strings that can ; also be valid identifiers. (prn :hello) (prn :hello_world) (prn :hello-world) ; Regular Expressions start with a #/ instead of a bare /, ; but are otherwise the same as in JavaScript, including ; support for modifiers. (prn #/foo/) (prn #/foo/g) ; Arrays are similar, but no commas between items. (prn [1 2 3]) (prn [1 :a [2 :b]]) ; Objects are similar, but no colons or commas ; between items. (prn {"hello" "world"}) (prn {:answer 42}) ; Booleans, null, undefined are same as in JavaScript. (prn true false null undefined)