-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
"Meaningful normal value" #2
Comments
What the fuck? The documentation (which you quoted a part of) already addresses all of your points. I expected better from you. |
The documentation states, "Reserving Moreover, using a value to denote a lack of value is not sound. Reserving another value, let's say, |
That's right, I am relying on my 13+ years of Common Lisp experience, here. (I recognize that the documentation for this project has not yet reached a platonic ideal, but I have much more important projects to work on.) One of my favorite design decisions in definitions-systems is using the simpler API for defsys:locate (returning Another library I'm working on, and which prompted me to finally create fakenil after years of always encountering the same damn problem, is a trivial protocol for arriving at a "guess" by consulting some "advisors", some of which may not have a particular preference in the matter. Here again, after initially considering to cargo-cult gethash, I decided to not support
Assuming that users indeed almost never need to represent
No shit? I've been saying that multiple values is an underrated feature since at least 2012 (quote: "probably Common Lisp's most underrated feature, by the way"), and some of my libraries use multiple values in exposed parts of the API, such as its, parse-number-range and cartesian-product-switch, and I have some libraries entirely dedicated to the concept of multiple values such as enhanced-multiple-value-bind and multiple-value-variants. Needless to say, my code also heavily uses multiple values internally, but I don't care to dig examples of that...
I extensively don't care about Alexandria, I haven't used it in probably at least a decade. I don't dispute that it's a fairly well-designed "personal utilities library", but I've come to hate that very concept, and from my personal perspective Alexandria is already mostly obsolete, and with a few of the libraries I'll be releasing this year I think I should be able to build a pretty good case to announce that Alexandria is "officially" obsolete. I think it's useful to remember that Alexandria is so damn popular in large part because of the official Quicklisp download statistics which count both direct and indirect downloads. I think it would be very interesting to see how libraries stack up if only direct downloads are counted...
It is extremely practical and entirely or mostly sound in most contexts, and sometimes you just don't have a choice to conform to existing API's. Note that using a distinguished value to represent "no value" is a classic technique notably to implement unbound slots, although fakenil would certainly not be an appropriate value to use in that context. fakenil is not an approach that makes sense in all contexts, but then all approaches to all problems don't make sense in all contexts. My recommendation would be to use fakenil in contexts where it makes sense, and not use it in contexts where it doesn't make sense.
What the fuck? Using member is the classical, obvious solution. I know it's just an example, but it's particularly ridiculous.
I know all this, aren't you happy that we now have an obvious place where to document all these caveats? By reifying this extremely common pattern, we are better able to reason about its strengths and shortcomings and advise others about them. |
My view is that it is better to use either 1) a non-local exit, possibly by signaling a condition or 2) using a value that is outside the logical codomain of the function to signal. Using I'm no longer going to put in effort on this package. I suggest nobody else does either. |
Of course that's going to be the right solution in some contexts, but in others you would just be complicating the API for everyone (users, implementors, extension designers) for no reason.
What the fuck? Isn't that what fakenil already provides? Of course, in some contexts you would indeed need to use a truly unique value such as a gensym or something, in which case, don't use fakenil if it's not suitable.
Actually, a big part of the point of fakenil is that most code will be able to pass along
Your nearly information-free commentary also seems to exist for no real purpose. (And I'm a nihilist.) The target market for fakenil is those who understand why it might be useful, or otherwise derive some value from it, not those who are convinced it is not useful. Most of the value of this library is obviously in the documentation, not the
You are an obnoxious child. I invite you to reflect on the unnecessary costs your impulsivity may inflict on yourself and others. |
It's an issue that has been long recognized as a mistake in the Common Lisp standard. A secondary value of |
By whom, when, where and why? This is the first time I hear of this, and I am not convinced at all.
So what? I almost never want to find I also wonder if your proposed design might sometimes incur a certain performance penalty, which I would not be eager to pay for, and I'm saying that as someone who mostly doesn't care about performance. Again, I just don't want to make my code slower just for the sake of gratuitous inconvenience... I'm open to being convinced, but you would have to provide more compelling arguments. |
This issue is resolved to my satisfaction, so I'm going to close this. Obviously, a cleaned up version of some of this content should be added to the documentation at some point, but this is a very low priority for me, as I have much more important projects to work on. Those with further meaningful commentary (as demonstrated by phoe) are encouraged to append to this issue. |
Mechanisms such as
gethash
already provide support for that behaviour, in form of a secondary return value that states whether the value was found (including aNIL
that was found in the hashtable) or whether the value was not found.What issue does your library solve that isn't already solved by the (much more standardized and popularized, I assume) mechanisms of returning an additional value for whether the object was found or not?
The text was updated successfully, but these errors were encountered: