sqlite api fix
[sxnasal.git] / CHANGES
blob808192e5cc1cdb4ac49b6903e41bcb9187181488
1 * added `typeofex()`, which returns "string" for strings, and "number" for numbers
2 * added d-like comments (including nested)
3 * added "0b" and "0d" numeric literals
4 * renamed `me` to `self`, `arg` to `__args`, and `parents` to `__proto`
5 * added `div` (integer division), and `%` (integer modulo)
6 * added `frac()` function to get fractional part of the number
7 * hacked in `&&` and `||` for `and` and `or`
8 * `true` is parsed as `1`, and `false` is parsed as `0` (hardcoded)
9 * added optional func names, function name can be used to perform recursive call (use self.<name> to call as method)
10 * you can also use function name to pass it as an argument to another function (i.e. it is almost a fully featured local now)
11 * added read-only hash items (as hashes are used for vars, we can have r/o vars with `const` instead of `var`)
12 * disabled assigns in `if`, `while` and `for` test expressions (use `(expr)` to override)
13 * do not allow duplicate local declaration with `var`
14 * added built-in property `.length` for vectors, strings, hashes and ghosts (r/o for now)
15 * it is possible to use vectors, hashes and ghosts as booleans (the same as "obj.length")
16 * in boolean expressions, strings will not be coerced to numbers (i.e. string "0" is true, not false; only empty string is false)
17 * `__proto` can be an object, or a ghost, not only a vector
18 * added simple optimiser (mostly constant folding for now)
19 * added `do {...} while (cond);`
20 * added `while (cond) {...} elsif (cond) {...} elsif (cond) {...}` (loop with multiple conditions; will execute the corresponding body)
21 * added `switch/case` (`case` will not automatically fallthrough; use `fallthrough` keyword if you need it; the exception is `case 1: case 2:`)
22 * WARNING! do not use `{}` scoping in `case`, it is automatically started; `case 1: {}` will create a hash!
23 * foreach loops can be written as `foreach (var a in expr)` too
24 * foreach/forindex loops can be used with ghosts, and function iterators
25   for functions, you should use coroutine:
26     func (idx, useIndex)
27   use `yield()` to return the iteration result, or exit the coroutine with `return` to stop
28   (return value doesn't matter in this case).
29   `yield()` result will be the next index, or `nil` if the loop was exited, and iterator must
30   perform finalisation.
31   `idx` starts with 0, and increments on each new iteration.
32 * implemented *experimental* `let` support. note that: `for (let v...)` and such will create ONE common `v` for all iterations!
33 * implemented *experimental* `try` support. this is just a syntactic sugar for calling `try_catch()` or `try_finally()`.
34     try { body } finally { finbody }
35     try { body } catch (e) { excbody }
36   note that `body`, `finbody` and `excbody` are actually anonymous functions! i.e. doing `return` from them will
37   return from the `try` construct, not from the outer function!
38   i.e. the compiler will rewrite everything into something like this:
39     try_finally(func { body }, func { finbody });
40     try_catch(func { body }, func (e) { excbody });
41   the interesting consequence of this transformation is that `try` returns a result. that is, you can write:
42     var res = try { code } catch (e) { exccode }
43     var res = try { code } finally { fincode }
44   for the first case, the result will be either from `code`, or from `exccode` on error.
45   for the second case, the result will be always from `code` (because error leads to failure).
46 * interned strings (symbols) now reside in a separate pool, which is not scanned by GC (there is no reason to scan it, symbols are persistent)
47 * strings are immutable now