A macro can't do this since it is strictly a pure source transform (it
cannot access values or variables). `eval` is essentially an escape hatch
to allow you to do anything, including this, but only in the global scope
(and it's generally not recommended).

it was a design decision in julia not to allow this in local scope. there
are much better ways of solving the problem that don't cause issues for
type inference. I recommend the following solution (in v0.4 syntax):

Dict{AbstractString, Any}( [ name => jld_load(joinpath(path, name*".jld))
for name in list ] )

(not tested, so please forgive any typos)


On Sat, Jul 11, 2015 at 5:26 PM Scott Jones <scott.paul.jo...@gmail.com>
wrote:

> Why are you limiting it to an ASCIIString?  variable names in Julia
> frequently have Unicode characters.
>
>
> On Saturday, July 11, 2015 at 4:06:43 PM UTC-4, Jeffrey Sarnoff wrote:
>>
>> I have been trying to loop over variable names available as an
>> ASCIIString vector, using each to generate the corresponding jld datafile
>> path+name and load_ing() the datafile into  its original variable name ..
>> should this be done with string->symbol manipulation and/or is a macro
>> required to effect an applicative assignment operator? I need some guidance
>> on how to do it.
>>
>

Reply via email to