Re: [julia-users] How to share state between functions

2014-03-31 Thread David P. Sanders
El lunes, 31 de marzo de 2014 12:14:23 UTC-6, Fab HK escribió: > > Hi David, > not entirely sure it is pertinent, but iterators might be a nice idiomatic > example, as they pass around state explicitly. See here: > https://github.com/JuliaLang/Iterators.jl/blob/master/src/Iterators.jl > Nice t

Re: [julia-users] How to share state between functions

2014-03-31 Thread Fab HK
Hi David, not entirely sure it is pertinent, but iterators might be a nice idiomatic example, as they pass around state explicitly. See here: https://github.com/JuliaLang/Iterators.jl/blob/master/src/Iterators.jl I found that a bit hard to understand initially, so I attach my "iterator cheat sh

Re: [julia-users] How to share state between functions

2014-03-30 Thread David P. Sanders
El viernes, 28 de marzo de 2014 11:45:51 UTC-6, Stefan Karpinski escribió: > > That seems like a reasonable way to do it. > OK, thanks. > > > On Fri, Mar 28, 2014 at 1:36 PM, David P. Sanders > > > wrote: > >> Hi, >> >> I often need to share state (a collection of modificable variables) >>

Re: [julia-users] How to share state between functions

2014-03-28 Thread Stefan Karpinski
That seems like a reasonable way to do it. On Fri, Mar 28, 2014 at 1:36 PM, David P. Sanders wrote: > Hi, > > I often need to share state (a collection of modificable variables) > between functions. > In Python and C++, I would do this by putting everything inside a class, > and the class variab

[julia-users] How to share state between functions

2014-03-28 Thread David P. Sanders
Hi, I often need to share state (a collection of modificable variables) between functions. In Python and C++, I would do this by putting everything inside a class, and the class variables (attributes) would act as "pseudo-global" variables (an excellent description that a student in one of my