Hi, 
I am learning about metaprogramming and macros. I have a very basic case 
but am unsure about what Julia is capable of. last time I asked a question 
here I got a very helpful answer shortly.

I am making sliders for a matplotlib plot. I would that when a slider 
changes, it changes some the value of some variable. Here is an example.

frequency = 2.0
function makeSlider(axSlider, variable):
  slider = widget.Slider(axSlider; valinit=variable)
  slider.on_changed(
    #WHERE I WANT THE MACRO TO GO
    variable = slider.val
  )
  slider
end
freqSlider = makeSlider(axFrequency,frequency)


Is this possible? I did not see any use cases like this in the 
documentation. 

I would normally do it by keeping all my constants as properties of some 
World type (or in some world Dictionary) and passing the key to the 
function, but I wanted to learn how to use this part of Julia.

Thanks!

Reply via email to