Skip to content
New issue

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

Accidental var naming with reserved keywords #320

Closed
jruz opened this issue Aug 16, 2023 · 1 comment
Closed

Accidental var naming with reserved keywords #320

jruz opened this issue Aug 16, 2023 · 1 comment

Comments

@jruz
Copy link

jruz commented Aug 16, 2023

Just ran into this were naively was defining a variable with same name as a core function, and trying to figure out why wasn't working.

Thanks a lot @borkdude for pointing it out 🙏🏼

Maybe some error msg is possible? or we could add to the docs a warning to not create vars with names this list?

(def count 0)

(defn increment []
   (set! count (+ count 1)))

output:

import * as squint_core from 'squint-cljs/core.js';
var count = 0;
var increment = (function () {
  return squint_core.count = (squint_core.count + 1);
});
@borkdude
Copy link
Member

Yeah, this needs to be fixed, thanks for reporting.

borkdude added a commit that referenced this issue Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants