-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no Base.tail for NamedTuple #29572
Comments
I suspect it's just an oversight; @JeffBezanson? |
Yes this can be added. |
Reflecting on this, think I agree with the wait & see approach, since I am not sure what semantics I would find useful. Originally I was expecting Base.tail((a = 1, b = 2, c = 3)) == (b = 2, c = 3) but then it turned out I need to work with the (first(x), Base.tail(x)...) == x would not hold either. The alternative is making Base.tail(nt::NamedTuple) = Base.tail(values(nt)) which seems kind of contrived too. |
Named tuples are ordered though, so returning a new named tuple with the first element dropped seems to make sense. |
* Add Base.tail(::NamedTuple). Fixes #29572. * Simplify, as suggested by @JeffBezanson.
Is this intentional, or is it just waiting for me to make a PR?
The text was updated successfully, but these errors were encountered: