We have to stop using # as a delimiter, because the 2021 edition reserved any identifier-prefixed # tokens making expressions like these no longer be legal:
$ does not suffer from this (and is more in the spirit of macros) so we're now moving all syntax to use it even if that means it's a bit more verbose.
This implements the following parser changes:
#var is now $var.
#(var + 5) is now $(var + 5)
#_(hello world) is now $[str](hello world).
#_(hello $world) is now $[str](hello $world) (runtime evaluation, like having hello ${world} in javascript).
#_(hello $(world + 1)) is now $[str](hello $(world + 1)) (runtime evaluation, like having hello ${world + 1} in javascript).
#_(hello #world) is now $[str](hello $[const](world)) (compile time evaluation, whatever value world has will become a component of the generated string).
The following control sequences are changed:
#<space> becomes $[' ']
#<push> becomes $['\r'].
#<line> becomes $['\n'].
This change will be part of the genco 0.17 release.
We have to stop using
#
as a delimiter, because the 2021 edition reserved any identifier-prefixed#
tokens making expressions like these no longer be legal:This would be seen as the
hello#world
token by Rust 2021, and since thehello
prefix is not recognized by the Rust compiler and would not compile. See https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html for more.$
does not suffer from this (and is more in the spirit of macros) so we're now moving all syntax to use it even if that means it's a bit more verbose.This implements the following parser changes:
#var
is now$var
.#(var + 5)
is now$(var + 5)
#_(hello world)
is now$[str](hello world)
.#_(hello $world)
is now$[str](hello $world)
(runtime evaluation, like havinghello ${world}
in javascript).#_(hello $(world + 1))
is now$[str](hello $(world + 1))
(runtime evaluation, like havinghello ${world + 1}
in javascript).#_(hello #world)
is now$[str](hello $[const](world))
(compile time evaluation, whatever valueworld
has will become a component of the generated string).The following control sequences are changed:
#<space>
becomes$[' ']
#<push>
becomes$['\r']
.#<line>
becomes$['\n']
.This change will be part of the
genco
0.17 release.