c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
3.03k stars 183 forks source link

request: compile-time comparison of constant vectors. #1575

Open Book-reader opened 1 month ago

Book-reader commented 1 month ago

It would be nice to be able to compare constant vectors at compile-time.

int[<2>] $foo = {1, 2};
int[<2>] $bar = {3, 4};
$if ($foo == $bar):
$endif

This is not really high priority for me, and if it is not implemented then I would like an error that says that vectors cannot be compared at compile-time instead of the current message that says that they are not compile-time constants.