Fork me on GitHub
#sci
<
2020-09-03
>
borkdude09:09:56

@jeroenvandijk I think I may have a nice solution for the macro rewriting problem: https://github.com/borkdude/sci/issues/397

jeroenvandijk10:09:21

yeah I think that would work and be user friendly when using the backtick. The only thing would be that the namespace symbol of the implementation would end up in Sci context somewhere. Not sure if that is a real issue

borkdude10:09:13

Why would that be an issue?

jeroenvandijk10:09:43

maybe if you would like to hide the underlying namespace structure to the Sci user

jeroenvandijk10:09:10

thinking out loud here, not even sure what you could do with that

borkdude10:09:19

If you would want to do that, then you could just not use this :)

jeroenvandijk10:09:45

Sounds like a good solution

borkdude10:09:36

The macros that will work with this are still only those who don't cause side effects at compile time and probably also not use &env

borkdude10:09:42

But that's most of the macros anyway

borkdude10:09:44

Another (more costly, but maybe not significant) solution would be to make sci postwalk the macroexpansion and replace the external namespaces with inner ones

borkdude10:09:10

Then the macro-expansion will also look more pretty

jeroenvandijk10:09:04

In a repl environment and using macroexpand the last option would be the least surprising as it doesn’t leak implementation details. But the performance concern is also a valid one

borkdude10:09:30

Maybe it's not that significant though, since this happens only once, not in a loop or anything

jeroenvandijk10:09:06

would one or the other matter for the output of stacktraces?

borkdude10:09:11

Good point. Maybe, I have to test this. I'll write it down in the issue.

👍 3