mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 08:39:30 +00:00
- Bumped to 0.15.0 - Add boot script - Change variable definition syntax, using a = to distinguish more cleary between identifier and value - Variables initial values are evaluated on first use instead of at parsing time - Error on variable redefinition. Means you should make sure to load saves after your scripts. - Improve string parsing, support for escape codes - Remove support for number literals with empty decimal part (42. for 42.0) as there's no distinction in Anselme and it conflicts with .function call suffix - Changed priority of : pair operator - Add type type, and type annotations to variables and function parameters - Change Lua function system to use regular Anselme functions - Defining a function from Lua is now way simpler and require providing a full Anselme function signature - Change Anselme function system - Dynamic dispatch, based on arity, type annotation and parameter names. Will select the most specific function at runtime. - Define way to overload most operators - Allow custom type to text formatters - Allow assignment to custom functions - Index operator ( renamed to () - Functions with parameters each have their own private namespace (scoping ersatz) - Internal: "custom"-mode operators now have their own expression AST type instead of cluttering the function system - Remove static type checker as it is barely useful with new function system. May or may not rewrite one in the future. - Improve error messages here and there - Internal: cleaning
26 lines
260 B
Text
26 lines
260 B
Text
$ fn(x::number)
|
|
x
|
|
|
|
$ fn(a="o"::string)
|
|
a
|
|
|
|
~ fn("s")
|
|
|
|
~ fn(5)
|
|
|
|
~ fn()
|
|
|
|
$ g(n="s", a=5::number)
|
|
@"gn"
|
|
|
|
$ g(n="s", a="lol"::string)
|
|
@"gs"
|
|
|
|
{g(n="k", a="l")}
|
|
{g(n="k", a=1)}
|
|
{g(n="k", "l")}
|
|
{g(n="k", 1)}
|
|
{g("k", "l")}
|
|
{g("k", 1)}
|
|
{g("k", a="l")}
|
|
{g("k", a=1)}
|