-fsanitize=address, which offers part of the functionality of valgrind
withand `with`, what do people think?
(with-do Array (side-effect) (side-effect))
(with* Array Int (single-form))
(defmacro and* [:rest forms] (build-vararg 'and forms)) (defmacro with* [:rest forms] (build-vararg 'with forms)) (defn player-colliding? [env-item player delta] (with* Rectangle Player EnvItem Vector2 (let [ppos (pos player)] (and* (<= (x (rect env-item)) (x ppos)) (>= (+ @(x (rect env-item)) @(width (rect env-item))) @(x ppos)) (>= (y (rect env-item)) (y ppos)) (< @(y (rect env-item)) (+ @(y ppos) (* @(speed player) delta)))))))
withis already a command is there much point at having a
*variant if we could just make the command behave like that by default?
withis a special form, so in that case you'd need to modify it – a macro isn't enough.
withas I don't think I can make the compiler change myself.
鲤 (load "Vector.carp") 鲤 (Vector2 1 1) I did not understand the form `(Vector2 1 1)` at REPL:3:2. Traceback: (Vector2 1 1) at REPL:3:1.
鲤 (deftype Wow [i Int]) 鲤 (IO.println &(str &(Wow 1))) (Wow 1) 鲤 (Wow 1) I did not understand the form `(Wow 1)` at REPL:12:2. Traceback: (Wow 1) at REPL:12:1.
env-items $[(EnvItem (Rectangle 0f 0f 1000f 400f) light-gray) (EnvItem (Rectangle 0f 400f 1000f 200f) gray) (EnvItem (Rectangle 300f 200f 400f 10f) gray) (EnvItem (Rectangle 250f 300f 100f 10f) gray) (EnvItem (Rectangle 650f 300f 100f 10f) gray)]