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
stephann: In another case, I wanted to merge values into a named tuple, but I wanted that existing values not to be overwritten, instead of **options.merge(x: 1, y: 2), I had to make **{ x: 1, y: 2 }.merge(options). Which isn't a problem at all, but it would be nice to have something like options.with_defaults(x: 1, y: 2), or options.reverse_merge(x:1 , y: 2).
straight-shoota: I believe an implementation of NamedTuple#reverse_merge could be accepted. IIRC something like this was mentioned in a discussion some time ago, but I can't find it.
The text was updated successfully, but these errors were encountered:
This would be useful in cases like this:
I think it makes clear that intent is to use the
html_options
primarily.I think the code would be something like this:
Based on @straight-shoota comment on Crystal discord channel.
The text was updated successfully, but these errors were encountered: