> 1. It'd suck to not be able to use 'id' as a variable name, and would conflict with a lot of existing code.
Michał Muskała gave brilliant and comprehensive answer > 2. Alternative names to 'id' or namespacing it are not shorter than '&(&1)' length is not the main point. But semantics is > 3. '&(&1)' is more open to change with requirements It would be still available )) > 4. Adopting 'id' within Kernel would encourage adding more utility functions to it, exacerbating 1, like the proposed 'filter' function The first point is not a problem in sense of variables. And you still can exclude some auto-imported functions > 5. Not adopting it within the Kernel would be hard, as there's no real appropriate place for it elsewhere in standard lib, unlike Enum's 'filter' It's true. That's why we should do this :) вторник, 2 июля 2019 г., 19:41:46 UTC+3 пользователь Christopher Keele написал: > > I'd cast my vote against this. The proposal seems to be: > > 1. Create a function named 'id' or some such > 2. Put it in the Kernel namespace (so it need not be prefixed) > > I've been doing a lot of python lately and they have a lot of things like > this, including the same 'filter' global function mentioned in this thread. > > Points against: > > 1. It'd suck to not be able to use 'id' as a variable name, and would > conflict with a lot of existing code. > 2. Alternative names to 'id' or namespacing it are not shorter than '&(&1)' > 3. '&(&1)' is more open to change with requirements > 4. Adopting 'id' within Kernel would encourage adding more utility > functions to it, exacerbating 1, like the proposed 'filter' function > 5. Not adopting it within the Kernel would be hard, as there's no real > appropriate place for it elsewhere in standard lib, unlike Enum's 'filter' > > Generally it's a nice idea, but I can't think of a great way to make it > work, and it'd open the floodgates to more utility functions that I've come > to find grating in day-to-day python development. > > Just my two cents, > Chris K > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/1bbde8cd-93d0-48e3-8cbe-51ac6fcea5b5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
