# Allowing the object.method(args...) syntax as an alias for method(object, args ...)

**URL:** https://discourse.julialang.org/t/allowing-the-object-method-args-syntax-as-an-alias-for-method-object-args/62051
**Category:** Internals & Design
**Tags:** question, design
**Created:** [May 29, 2021, 5:09pm UTC](https://discourse.julialang.org/t/allowing-the-object-method-args-syntax-as-an-alias-for-method-object-args/62051 "2021-05-29T17:09:54Z")
**Posts on this page:** 1
**Showing post:** 65

<div class="post-metadata">

### Author: ![jessymilare](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jessymilare/32/13750_2.png) [@jessymilare](https://discourse.julialang.org/u/jessymilare)
#### Post date: [June 14, 2021, 6:08pm UTC](https://discourse.julialang.org/t/allowing-the-object-method-args-syntax-as-an-alias-for-method-object-args/62051/65 "2021-06-14T18:08:26Z")

</div>

Yes, of course, clarity is relative, not only to people, but also to conventions of programming languages. In pretty much any language that accepts the syntax `x.f(y)`, it means taking a field `f` from object `x` and applying it to `y`. In Python, this field is also called method, which is a function in which `x` is curried as its first argument, but that is detail. E.g.:

```julia
# python3
Python 3.9.5 (default, May 11 2021, 08:20:37) 
>>> func = "abcdefghij".replace
>>> func('a', '1')
'1bcdefghij'

```

So, the syntax the OP is proposing would be confusing to Julian users and to newcomers. Because, in Julia, methods are not fields and `String`s don’t have a field called `replace`.

Now, the syntax `x⤷f(y)` is not confusing and it could be made clear and consistent. However, you need to remember the shortcut for ‘⤷’, which requires more than one char. Another problem is it’s not flexible - if you want to apply `map` and friends to collections, you would need to specify that the incoming object is the second or third argument of your method, so you would need some marker to specify in which place the object is curried - like `_`.

In the end of the day, `vec⤷map(sqrt, _)` and `vec |> map(sqrt, _)` requires that you type around the same number of chars, but the latter contains only one new syntax to understand - and that new syntax is useful in much more contexts than chaining.

---

_[View the full topic](https://discourse.julialang.org/t/allowing-the-object-method-args-syntax-as-an-alias-for-method-object-args/62051)._
