Ward
Ward
Fix a small bug I found in `compiler.c`.
1. String in pocketlang could be include \x00, but String.split() don't. 2. If [sep] is empty, split string into characters. 3. String.split should be the opposite of List.join perfectly. Example:...
1. Add built-in string comparing. 2. Add algorithm module, include sort, isSorted, binarySearch, reverse. 3. Wrap these functions to methods of List. Example: ```ruby print([4, 5, 1, 3, 2].sort()) print([4,...
1. List/map constructor can accept a list/map, works as copy constructor. 2. The original list constructor is abandoned, it do the same thing as _list literal_ . 3. List constructor...
Sprintf or ruby's `%` operator for pocketlang. Support following specifier: `diuxXobfFeEgGcs`. Example: ```ruby print("Number is %d" % 12) print("Number is %d, type is %s" % [13, "cat"]) print("[%10s]" % "carrot")...
Example: ```ruby class Foo def test(a, b, c) end end print(Foo.test.arity) ``` Output: ```3```
Base on splitmix64, a fast but non-cryptographic PRNG. Example: ```python from random import rand, sample, shuffle isInteger = true print(rand(100, isInteger)) print(rand(50..100, isInteger)) print(rand(50..100, isInteger)) print(sample([1, 2, 3, 4, 5]))...
This re module is based on a modified pike vm and have following features: 1. Lightweight (about 15~20k only, depend on compile flags). 2. Support almost all common RE pattern...
Example: ```ruby assert(r"^\d\d:\d\d:\d\d$" == "^\\d\\d:\\d\\d:\\d\\d\$") assert(r"C:\Windows\System32" == "C:\\Windows\\System32") ``` This enhancement is essential for [re module](https://github.com/ThakeeNathees/pocketlang/pull/266).
This file cannot be compiled, this is a fix.