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
@kbauer: I'd like to discuss auto unwrapping seperately - your input is very welcome.
Regarding the auto conversion in map(): I am also constantly annoyed by this, but I am also extremely reluctant to change this, mainly for these reasons:
_.each should behave the same for all the other iterators like .each(), .filter() and friends
_.each should behave consistent in all contexts if possible
_(dict(foo='bar')).call(_.each['foo'])._=='bar'
It should be possible to abstract over _.each with .map() and friends. Like this:
Now that I think about it, it is really hard to come up with a useful example, where one would want to abstract over _.each with the iterators. Maybe it would be good enough to have an off switch for auto termination that one would have to explicitly set on _.each. Maybe something like _.each._disable_auto_termination() (now that is ugly, but also unlikely to clash with any operation you want to do on _.each)
I am really not sure. I know that it is impossible to really fix _.each auto termination in all circumstances, as you can always wrap in a dict or something to make it invisible to wrapper().
But maybe 'most of the time' is actually good enough to make a difference?
As for a migration, we could start by adding a warning to all wrappers if you hand in a unterminated _.each and ask users to report if they see it. That way we get a feel if there is actual usage of this feature.
The text was updated successfully, but these errors were encountered:
@kbauer: I'd like to discuss auto unwrapping seperately - your input is very welcome.
Regarding the auto conversion in
map()
: I am also constantly annoyed by this, but I am also extremely reluctant to change this, mainly for these reasons:_.each
should behave the same for all the other iterators like.each()
,.filter()
and friends_.each
should behave consistent in all contexts if possible.map()
and friends. Like this:Now that I think about it, it is really hard to come up with a useful example, where one would want to abstract over _.each with the iterators. Maybe it would be good enough to have an off switch for auto termination that one would have to explicitly set on
_.each
. Maybe something like_.each._disable_auto_termination()
(now that is ugly, but also unlikely to clash with any operation you want to do on_.each
)I am really not sure. I know that it is impossible to really fix
_.each
auto termination in all circumstances, as you can always wrap in a dict or something to make it invisible towrapper()
.But maybe 'most of the time' is actually good enough to make a difference?
As for a migration, we could start by adding a warning to all wrappers if you hand in a unterminated
_.each
and ask users to report if they see it. That way we get a feel if there is actual usage of this feature.The text was updated successfully, but these errors were encountered: