Clojurians
#cljs-dev
<
2015-09-06
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

mfikes15:09:23

[self-host] The pprint.clj file is almost usable from bootstrap, apart from one use of macroexpand. One conditionalized solution involves the use of cljs.js. Perhaps this big hammer can be employed as a last resort when porting ClojureScript macro implementations that use certain Clojure-specific features. I’m wondering if there might be a better solution and if others here have ideas. Here’s my whack at it: https://github.com/mfikes/clojurescript/commit/5a79cab0f288511ed6cb38fc9a8808dea6393f4d

darwin16:09:33

@mfikes I’m eager to hear about your progress on macroexpand, I read your recent blogpost - kudos! that gist link, is it tested code? I don’t think make-sync works as intended

darwin16:09:20

I don’t think it is possible to turn async call into a sync call without introducing some kind of promise system

darwin16:09:29

I believe it will work only in cases when cljs/eval decides to call cb synchronously

darwin16:09:41

in other cases res will be nil when dereferenced

mfikes16:09:26

@darwin: It works. (See the comment below the code showing it working.) In general, you are right and this code could in theory fail. I think it is working because no async calls to *load-fn* are being made. A proper solution would likely involve rippling the async nature through the users of the macro, which would likely be problematic.

darwin16:09:15

ok, sounds like an improvement to me, just raise some exception with explanation when someone calls it with async behaviour

mfikes16:09:10

@darwin: I'm wondering if there is any other way to do the macroexpand call.

darwin16:09:18

@mfikes: unfortunately I don’t have such deep understanding, good luck!