If we also want to have a function in the Map module I think that the verb 
should be put, not update (since the operation described in my first post 
is effectively a put operation), so eitherx put_if or maybe_put.

Regarding the proposed Kernel macro, it seems to me that it can be used in 
a more general sense and not only for updating collections (the first 
argument can effectively be anything), so I like the run verb. It could 
also be apply_if.

In both cases I personally I find the _if suffix more expressive than the 
maybe_ prefix, in my opinion this

|> run_if(x == 1, some_fun)

reads more naturally and better conveys the role of the arguments than

|> maybe_run(x == 1, some_fun)

--
Riccardo

On Monday, June 8, 2020 at 2:57:32 AM UTC+2, Bruce Tate wrote:

> I like the idea as well. And I like the name maybe_update. 
>
> -bt
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/12633886-f5ce-4b9f-b27c-b0871b472554o%40googlegroups.com.

Reply via email to