Mercerenies / gdlisp

Lisp on the Godot platform
GNU General Public License v3.0
146 stars 1 forks source link

Literal Vector Representation of `V{ ... }` is causing problems #39

Closed Mercerenies closed 3 years ago

Mercerenies commented 3 years ago

Currently, when calling macros, we represent V{x y} as a literal Vector2(x, y). This seemed clever at first, but it's causing all kinds of problems. The representation makes sense at runtime, but not at the macro level. If we try to pass V{x y} to a macro, it gets passed as

Vector2(Symbol.new("x"), Symbol.new("y"))

which is a definite problem, because vectors can only contain floating-point values.

We need to make V{...} desugar directly (at the parse level, if possible) to a (vector ...) call so that it's represented like everything else is.

Mercerenies commented 3 years ago

Definitely blocks-bootstrapping. Even basic constructs like if statements are macros, and if we can't pass vectors to if statements, then we have a problem.