Closed darscan closed 12 years ago
Interesting. In Swiftsuspenders 1, I had the core assumption that null wasn't a valid value to map. Meaning that mapping null was pretty much the same as not doing a mapping. It seems like in 2 I inadvertently watered down that assumption.
Unfortunately, it's not that easy to restore it without quite some added complexity. Because of that (and because I prefer early errors) the best course of action seems to be to simply throw on an attempt to map null.
Yell if that seems to harsh, otherwise I'll just go ahead with it.
Yell! I think that null is a perfectly valid value to map, what was your core assumption based on?
So there was an elaborate theory behind this that was based on principles of simplicity and I'm pretty sure that Occam's Razor figured into it and it was Very Important in its entirety.
Unfortunately, I can't remember the least bit of it and it might have been a fever dream after all. Maybe not even that is true, who knows? Anyway: yell accepted.
hahaa!!! Speaking of simplicity, Occam's Razor and The Principle Of Least Surprise, I would expect that what I map is what I get. Symmetry is important, especially for libraries upon which other libraries are built :)
Right. Maybe it was that and I surprised myself by doing the opposite? We will never know, I'm afraid. We will have support for mapping 'null' as a value again, though.
LOL and YAY!
If I map a named value to null, satisfies returns true, but getInstance fails: