# Babble language reference Types: * Babble supports the same types as JSON: arrays, objects, strings, numbers, booleans and null. Literals: * nil, true, false Comments: * introduced by a semicolon at the start of a line * there can be whitespace before them but nothing else Strings: * quote with "..." or '...' * character escapes: \n, \t, \r, \f, \e * backslashes and quotes can't be escaped Special forms: * variables: get, set, var * logic: and, or, if, when, cond * loops: while, dolist, dotimes, do * functions: function, lambda * code blocks: do, quote Functions: * math functions: +, -, *, /, div, mod, expt, abs, round, floor, min, max, odd?, even? * comparisons and logic: =, <, >, <=, >=, not, not= * I/O: print, println, perror, readln * conversions: parse-integer, parse-float * data structures: list, dict, append, length, slice, join, item, setitem, keys, member?, push, pop, sort, empty? * strings: string, split, trim, trim-left, trim-right, starts-with?, ends-with?, upcase, downcase, capitalize * character class predicates: alphabetic? numeric? whitespace? upper-case? lower-case? * type predicates: null? boolean? list? dict? string? number? procedure? * functional programming: apply, map * error handling: protect, error * file I/O: read-file, write-file, append-file * OS interaction: load, timer, quit * others: doc, help, parse, eval Note: readln, timer, perror, load, eval and quit are only defined in stand-alone mode.