You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions like put_in or update_in are very useful to work with nested data, so naturally they'd be nice for Elixir AST.
Unfortunately, the Elixir AST is just tuples, and we can't implement Acesss for them.
Moreover, a hypothetical lens-like operation like update_in(ast, [:def, :function_name], &change_node_name/1) would crash with the Access semantic, as it would first find the def nodes, then crash if any of them doesn't have a function_name child.
So, our implementation needs to ignore the elements it can't match instead of crashing.
The text was updated successfully, but these errors were encountered:
Functions like
put_in
orupdate_in
are very useful to work with nested data, so naturally they'd be nice for Elixir AST.Unfortunately, the Elixir AST is just tuples, and we can't implement
Acesss
for them.Moreover, a hypothetical lens-like operation like
update_in(ast, [:def, :function_name], &change_node_name/1)
would crash with theAccess
semantic, as it would first find thedef
nodes, then crash if any of them doesn't have afunction_name
child.So, our implementation needs to ignore the elements it can't match instead of crashing.
The text was updated successfully, but these errors were encountered: