Closed jrfondren closed 12 months ago
The <comptime>
was not designed to be used with custom records, it was designed to work with just simple primitives like string
, boolean
, numbers and enums so the compiler can do simple in-place replacement of values.
But this deserves a better error message, I added one in https://github.com/edubart/nelua-lang/commit/3343daa7da088bba4e151f96849f80ebe4351cc8
Thanks for reporting.
Code example
Expected behavior
As
<comptime>
enums work well, I expected records to work similarly. For example, this is fine (and is an adaptation of a Lisp macro example from Let Over Lambda):Workaround
In these examples, everything works as intended without
<comptime>
.Environment
x86_64 linux Nelua 0.2.0-dev Build number: 1588 Git date: 2023-09-16 16:20:44 -0300 Git hash: 596fcca5c77932da8a07c249de59a9dff3099495 Semantic version: 0.2.0-dev.1588+596fcca5 Copyright (C) 2019-2022 Eduardo Bart (https://nelua.io/)