Results 27 issues of Ward

In many other language, ternary operator (:?) is the syntax for basic conditional expression. However, in some language (e.g. coffeescript), they use `if expression` as conditional expression. This patch adds...

The [Language Manual](https://thakeenathees.github.io/pocketlang/#/GettingStarted/LanguageManual?id=language-manual) says: > Note that a call of form f(fn ... end) is a syntax sugar for f fn ... end where f is a function or a...

`compile` can compile the source code into a closure at runtime time. Example: ```ruby message = "Metaprogramming" value = 12345 code = " def test return $value end print('$message') return...

Basic error handling via fiber. Example: ```ruby fb = Fiber fn [][1] end fb.try() if fb.error print(fb.error) else print("OK") end ``` Output: ``` List index out of bound. ``` Also...

Change the callable behavior: "extra arguments are thrown away; extra parameters get null" (like lua). Moreover, parameters can have default value, even if the default value is an expression. Example:...

Native function can have variadic parameters by using pkGetArgc. But it seems no way to have this ability it in script. Am I wrong?

TODO

For example: ``` def inc(v, n = 1) return v + n end v = 0 print(inc(v)) print(inc(v, 2)) ``` -- I love this little script language very much, please...

TODO

* add array of magic methods to class struct. * current magic methods: _init, _getter, _setter, _str, _repr, _call. * optimize method calling for magic methods. * add _call so...

Object can be used as iterator if _next and _value is defined. Similar to [wren's iterator protocal](https://wren.io/control-flow.html). Example 1: ```ruby class Countup def _init(first, last, step) self.first = first self.last...

Example: ```ruby from types import Vector class Vector2 is Vector def *=(n) self.x *= n; self.y *= n; self.z *= n return self end end v = Vector2(1, 2, 3)...