We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
small improvement to your code: in Common Lisp setting a variable is a different operation from defining it.
(defun check-collision-all (item) (setf collides nil) (loop :for elem :in (nth (- *game-state* 2) *levels*) :when (check-collision item elem) :do (setf collides t)) collides)
You have that pattern in your code elsewhere, too. load-level and check-collision for example.
SETF does not define a variable, but sets it only. To define a function local variable one has two options: let and (not that often seen) &aux:
(let ((collides nil)) (loop ... (setf collides t) ...) collides)
or
(defun check-collision-all (item &aux (collides nil)) (loop ... (setf collides t) ...) collides)
Otherwise collides possibly would be a global and undefined variable. A Common Lisp compiler will typically warn about that.
collides
The text was updated successfully, but these errors were encountered:
Thank you for the info. Indeed I was getting quite many warning messages however did not really know the cause. Soon I will refactor with this info.
Sorry, something went wrong.
No branches or pull requests
small improvement to your code: in Common Lisp setting a variable is a different operation from defining it.
You have that pattern in your code elsewhere, too. load-level and check-collision for example.
SETF does not define a variable, but sets it only. To define a function local variable one has two options: let and (not that often seen) &aux:
or
Otherwise
collides
possibly would be a global and undefined variable. A Common Lisp compiler will typically warn about that.The text was updated successfully, but these errors were encountered: