Re: [julia-users] Re: Setting/getting field-like members with side effects

2016-10-09 Thread Chris Rackauckas
Yes, symbols would be preferred. Checking equality two symbols is quicker, but, more importantly, symbols are natural to Julia metaprogramming/expressions, meaning that if you use symbols then the expression is easier to generate via macros. Tom is getting shy, but really take a look at Stochas

Re: [julia-users] Re: Setting/getting field-like members with side effects

2016-10-09 Thread Bart Janssens
OK, thanks, so symbols are definitely preferred for the [] variant then? As for using dispatch, I am certainly all for designing a "proper" Julian interface, but the number of parameters here can be daunting, see e.g. here for a more complete example: https://github.com/barche/coolfluid3/blob/mast

[julia-users] Re: Setting/getting field-like members with side effects

2016-10-09 Thread Chris Rackauckas
Missed that one, though it should be mysolver[:linear_system][:parameters][:solver_type] = :GMRES There's no reason for an algorithm choice to be a String. But this entire thing seems wrong-headed. The choice of the solver method should likely be done by dispatching on the solve method somehow.

[julia-users] Re: Setting/getting field-like members with side effects

2016-10-09 Thread Kristoffer Carlsson
That was one of the suggestions?

[julia-users] Re: Setting/getting field-like members with side effects

2016-10-09 Thread Chris Rackauckas
Why not use Symbols instead of strings here? On Sunday, October 9, 2016 at 8:26:57 AM UTC-7, Bart Janssens wrote: > > Hi all, > > I'm thinking about how to translate a Python interface that makes > extensive use of __getattr__ and __setattr__ overloading to allow chaining > a series of option va

[julia-users] Re: Setting/getting field-like members with side effects

2016-10-09 Thread dnm
What about nested modules? Or unpure functions chained with the pipe operator? On Sunday, October 9, 2016 at 11:26:57 AM UTC-4, Bart Janssens wrote: > > Hi all, > > I'm thinking about how to translate a Python interface that makes > extensive use of __getattr__ and __setattr__ overloading to al