[julia-users] Re: Creating variables programmatically

2015-11-03 Thread cormullion
Hi Patrick. I'm never sure about things like this, but it seemed like a good approach to investigate. I want to load 20 or so images from disk and access them using predictable names. On Tuesday, November 3, 2015 at 2:05:45 PM UTC, Patrick Kofod Mogensen wrote: > > I know this does _not_

[julia-users] Re: Creating variables programmatically

2015-11-03 Thread David P. Sanders
El martes, 3 de noviembre de 2015, 10:27:27 (UTC-6), Dawid Crivelli escribió: > > How about using a dictionary instead of variables, to do something like > the following: > > images = Dict{AbstractString, Image}() # dictionary associating an > Image object to a string > image["flower"] =

[julia-users] Re: Creating variables programmatically

2015-11-03 Thread Patrick Kofod Mogensen
I know this does _not_ answer your question, but are you really sure you want to do this? Can't you just push your variables to an array, and access them as x[1], x[2], ... ? On Tuesday, November 3, 2015 at 2:40:34 PM UTC+1, cormu...@mac.com wrote: > > I can't work out the syntax for creating

[julia-users] Re: Creating variables programmatically

2015-11-03 Thread Dawid Crivelli
How about using a dictionary instead of variables, to do something like the following: images = Dict{AbstractString, Image}() # dictionary associating an Image object to a string image["flower"] = imread("flower.png") # made up function name Accessing the dictionary won't significantly