I found this while writing unit tests for Toy_Function, where one
(native) function was named 'identity' and another (custom) was named
'ident' to avoid a naming clash. The rename didn't resolve the clash, so
after some digging, I found that strings compared to substrings would
return a match, despite being different.
This took some awkward corner-case handling, as it turns out
'deepCompareUtil' only returns zero when no differences have been found,
not when a match has been found. I also added checks for this to
Toy_String's unit test, with the parameters checked in both orders i.e.
(a,b) and (b,a), because paranoia is your friend.
The rope pattern is powerful, but also gives you enough rope to hang
yourself.
This required a massive cross-cutting rework to the scope system,
multiple subtle bugfixes and relearning of the parser internals, but it
does appear that functions are working correctly.
A few caveats: for now, parameters are always constant, regardless of
type, return values can't be specified, and some script tests have been
written.
Most importantly, a key feature is working: closures.
Also fixed a minor bug with printing, and removed the ability to
configure the parser.
Added and updated QUICKSTART.md as a quick way to get people started.
There's some broken scripts under 'scripts/' that require functions to
work properly.