Remix.run Logo
kmarc 2 days ago

Reminds me of vim script's implicit method syntax [1]

Eg. any function call can be converted to a method call on the function's first parameter:

    let mylist = [3, 2, 1]
    " prints "1" as these two are equivalent
    echo sort(mylist) == mylist->sort()
Helps a lot with chaining.
kyleee 16 hours ago | parent [-]

Quirky and awesome

kmarc 9 hours ago | parent [-]

If you think about it, it's the mirrored version of python object/class methods: they receive the object (self) / class (cls) as the first parameter. Same with Rust's trait impl's methods.