# OOP-like dot notation in Julia

**URL:** <https://discourse.julialang.org/t/oop-like-dot-notation-in-julia/120971>\
**Category:** Internals & Design\
**Created:** [October 6, 2024, 11:18am UTC](https://discourse.julialang.org/t/oop-like-dot-notation-in-julia/120971 "2024-10-06T11:18:07Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [October 6, 2024, 2:51pm UTC](https://discourse.julialang.org/t/oop-like-dot-notation-in-julia/120971/18 "2024-10-06T14:51:14Z")

</div>

> [@Barget](#):
>
> this is just a sugar syntax that does `method(object, otherargs...)` … but really helpful to chain calls, discover code

For function discovery, a better autocomplete would indeed be useful!  
Does it have to be `object.<tab>`? Maybe, but also consider alternatives that mesh better with the existing Julia syntax – eg, `?(object<tab>` or similar.  
Anyway, autocomplete is not currently limited by the lack of syntax, and could definitely be improved.

> [@Barget](#):
>
> Unfortunately, each time I give a chance to this approach, I end up creating anonymous functions at each piping step, which is very teddious. This is usually to do currying using the return value of the previous step. To me, this is a very common pattern for which I have hard times trying to find reasonable alternatives.

Many Julia functions that one commonly wants to pipe take either a function or some model object as the first argument, while the natural “object” goes as the second/last argument.  
[DataPipes.jl](https://github.com/JuliaAPlavin/DataPipes.jl) ([discussion](https://discourse.julialang.org/t/ann-datapipes-jl-0-3-0/60734)) is specifically designed for zero-boilerplate piping in this very common scenario, while still supporting functions that take the “object” as the first argument.  
Not sure if using `.` for piping is much more convenient to warrant such major changes…

---

_[View the full topic](https://discourse.julialang.org/t/oop-like-dot-notation-in-julia/120971)._
