Dave Copeland :ruby: on Nostr: nprofile1q…szr50 Yeah, the idea of "return nil if the arg is nil” is to contain ...
nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqd6t07avcds2swp4xrmel283zrad4x5q2x6a6arncnwhf40w20vaqnszr50 (nprofile…zr50) Yeah, the idea of "return nil if the arg is nil” is to contain nils and not let them leak into object state, i.e. if a header is a name and a value, the name should never be nil, thus no Header should ever be created with a nil name.
Depending on context, "return nil" could also be "blow up”, but same general structure works.
It would be cool if Ruby allowed TypeName(…) to be auto-defined as a conversion for types you define.
Depending on context, "return nil" could also be "blow up”, but same general structure works.
It would be cool if Ruby allowed TypeName(…) to be auto-defined as a conversion for types you define.