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

*print-fn* / dynamic vars #178

Open
borkdude opened this issue Aug 29, 2022 · 2 comments
Open

*print-fn* / dynamic vars #178

borkdude opened this issue Aug 29, 2022 · 2 comments

Comments

@borkdude
Copy link
Member

*print-fn* controls printing in CLJS. with-out-str build on that (#31). This brings up the question if we should have dynamic vars that you can set! and use with binding or if we want to deviate from CLJS here. *print-fn* could also just be an atom.

@borkdude
Copy link
Member Author

I thought a little bit more about the mutable es6 exports.
I think we could maybe just do this as well:

(def x 1)
=>
var x = 1
function _set_x(v) {
x = v;
}
export {x, _set_x}
and then we can always leverage _set_x to make mutations

@borkdude
Copy link
Member Author

Thought about it some more: this won't work with changing the module over time, it will only work for things that were already defined in the module, but you can't add extra stuff to the module.
So the .dev.js output should maybe just use global nested objects as modules (can always mutate and add stuff) and the .js (production output) should just be the finalized es6 output

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

1 participant