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

@loadAndGenerate #60

Closed
milanflach opened this issue Mar 26, 2018 · 1 comment
Closed

@loadAndGenerate #60

milanflach opened this issue Mar 26, 2018 · 1 comment

Comments

@milanflach
Copy link
Collaborator

Would be nice to enable the @loadAndGenerate also for "$Var" evaluation in strings.
In order to to so, I would propose to use eval(i) instead of i in the joinpath command:

l.178 CABLABTools.jl :
if !CABLAB.recalculate() && all(i->isdir(joinpath(CABLABdir(),eval(i))),$xnames)

which evaluates the "$Var" expression first, before passing it to the joinpath() function as joinpath() throws an argument type error for expressions...

@meggart
Copy link
Member

meggart commented Dec 17, 2018

Using eval in a macro is generally regarded as bad style, since the evaluation will happen at parse-time and not at run-time. This can lead to very unexpected behaviour when running the macro from different scopes or from within functions etc.

@meggart meggart closed this as completed Dec 17, 2018
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