Re: [julia-users] Create local function variables programmatically from a dictionnary

2016-01-28 Thread Fady Shoukry
lia-users/axwQqFeIlCQ >>> >>> On Wed, Jan 27, 2016 at 11:05 PM, Yichao Yu <yyc...@gmail.com >>> > wrote: >>> >>>> On Wed, Jan 27, 2016 at 9:47 PM, Fady Shoukry <fadyms...@gmail.com >>>> > wrote: >>>> > >>>>

[julia-users] Programmatically creating variables from a dictionary

2016-01-27 Thread Fady Shoukry
Hey everyone, As the subject line suggests, I am trying to programmatically create variables from a supplied dictionary in a function. I am aware that I can use eval() but eval will generate global variables which is something I am trying to avoid for its performance disadvantages. Here is an

[julia-users] Create local function variables programmatically from a dictionnary

2016-01-27 Thread Fady Shoukry
Hi everyone, As the title suggests, I am trying to create local variables to a function for a supplied dictionary argument. The Dict would be of type {Symbol, Any} and the goal is to create a variable for each symbol that has the corresponding value. I am aware that I could use eval in

Re: [julia-users] Create local function variables programmatically from a dictionnary

2016-01-27 Thread Fady Shoukry
> > Depending on what API JuMP provide and what API you want to provide, I > think you should either keep the dict (if JuMP can handle it) or use > meta programing to construct an AST/function based on the user input > and evaluate that. > Thanks for the quick reply. Could you elaborate on