In Julia, when people use x.f(y), what he actual means is f(x, y) (assuming 
f relies on x). So there is no need to define f inside a type, just define 
f(x,y) outside.
So, my first conclusion is: it is not a good practice to put function 
inside a type.

If there is a rule that people can not define function field in a type, 
then set x.f(y) = f(x,y) does not have the confusion you mentioned early.
Also x.f might be good for multi-dispatch. I am not sure how multi-dispatch 
is implemented, but the prefix x seems provide a good heuristic.

Best,
Cheng

On Thursday, October 8, 2015 at 12:03:45 AM UTC+2, Stefan Karpinski wrote:
>
> This is a real issue but I don't think that aping the syntax of a very 
> different paradigm is the right solution.
>
> On Wednesday, October 7, 2015, <jonatha...@alumni.epfl.ch <javascript:>> 
> wrote:
>
>> I think the auto-completion is a bit of an issue, it makes Julia 
>> functions not easily discoverable. In other language when you have a string 
>> you can just type dot and tab and see all the methods that you can apply to 
>> your string, so you almost never need to go to the doc.
>>
>> Something similar should be possible to implement in Julia with 
>> methodswith but I'm not sure any IDE support that yet. methodswith might 
>> also be too slow for that purpose.
>>
>

Reply via email to