This is usually not what you want to do.

On Sunday, January 17, 2016, Steve Kelly <[email protected]> wrote:

> It has always been this way because of multiple dispatch. However you can
> do something like:
>
> type Wallet
>   dotTest::Function
> end
>
> Which might have ambiguous performance impact.
> On Jan 17, 2016 12:45 PM, "Bryan Rivera" <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> I have seen some code out in the wild that allows us to use dot syntax
>> like so:
>>
>> function dotTest!(wallet::Wallet, valueToAdd::Int):
>>
>> ...
>>
>> end
>>
>> wallet = Wallet(100)
>>
>> wallet.dotTest!(5)  # Does not work
>> dotTest!(wallet, 5)  # Works
>>
>> However I cannot get it to work, the method is not found because I am not
>> passing wallet as the arg.
>>
>> So did the language change, or am I doing it wrong?
>>
>

Reply via email to