On Feb 8, 2020, at 6:34 PM, José Valim wrote:
>
> Also, I should have asked this sooner, but can't the complex path that you
> are writing be easily expressed with pattern matching?
Can your use cases use pattern matching too?
Since you asked, my primary use of Kernel.get_in is when I have
To be honest, I am not sure either. I am not sold on Access.path/1 as a
name. Using "path" makes it sound like it is a general abstraction but it
isn't. Passing an Access.path to put_in or update_in won't make them
suddenly accept nils because in there it is a more complex problem (you
need to
I'm uncertain how best to proceed at this point. I have some code that is a
proof of concept of what I believe is a compromise. I don't wish to open
another PR prematurely and have it closed, so I'll try one more round of
discussion here.
I have added 2 new Access functions: path/1 and
Hi Kensei!
So the reason we don’t allow negative indexes for tulles is because we
would have to support them on elem/2 but if we do so it can’t work on
guards (at least not efficiently).
Also, as the docs for Tuple says, you should really really avoid index
access for tuples. Pattern matching is
Hi !
I propose modifing Tuple.insert_at/3 and Tuple.delete_at/2 to
allow neg_integer index, like Enum.at/3
Specifically, I would like to fix as below. (and delete insert_at and delete_at
from elixir_rewrite.erl)
@spec insert_at(tuple, integer, term) :: tuple
def insert_at(tuple, index,