On Friday, January 2, 2015 6:13:36 PM UTC-5, Jason Knight wrote:
>
> Lex, check out Tim's suggestion here 
> <https://groups.google.com/d/msg/julia-users/GXH8UBFYd0U/iiuXZswbaJUJ>. I 
> believe this can also be done with a let binding, but I can't seem to find 
> the reference and my Julia is compiling so I can't rework the incantation 
> atm. Thanks for documenting!
>
> Jason
>
>  
My understanding from that thread is that you can make additional variables 
that constructors can see, but are still not visible from methods operating 
either on objects of that type or on the type singleton object. It would be 
great if you could check on how it might work with let though.


> On Friday, January 2, 2015 4:54:51 PM UTC-6, ele...@gmail.com wrote:
>>
>> Am waiting for an answer to the question about a mutable version before 
>> adding doc.
>>
>> Cheers
>> Lex
>>
>>
Regarding documenting it, I would suggest expanding the picture a bit more 
rather than just giving this particular example. It is not strictly 
"associating static data" with a type, but rather the direct equivalent of 
a C++ static method which might do any number of things. 

It seems to me that on a first pass through the manual, it is not 
immediately obvious to a c++/java programmer how Julia's method/type 
interaction is a superset of what he or she is used to. The section 
mentioned in Noteworthy Differences could expound on how 
obj.get_param(name) in C++ is exactly reproducible with get_param(obj, 
name) in Julia, and how this pattern also translates to static methods with 
MyObject::data() matched with data(MyObject). All of this info is already 
present in the manual of course, but it is somewhat spread out, and it took 
me some time, at least, before it clicked.

Reply via email to