Skip to content

Instantly share code, notes, and snippets.

@edgurgel
Created April 29, 2014 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgurgel/11395715 to your computer and use it in GitHub Desktop.
Save edgurgel/11395715 to your computer and use it in GitHub Desktop.
Hey guys,
Now that ListDict is dead, I'm using List API and I find annoying that we need to specify the key position on the tuple (I know this is not a dict) and I think it would be nice to have position as 0 by default.
My proposal is to have a function with less arguments that call the original with 0. We could have position on the end as optional argument, but this would break people's code and maybe harder to read.
keyreplace(list, key, new_tuple) -> keyreplace(list, key, 0, new_tuple)
This would be keyreplace, keystore, keyfind. Also other functions that already have position on the end could be 0 by default.
I think this could help people that is moving from ListDict (at least for some usages).
What you guys think?
Thanks in advance,
Eduardo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment