-
Notifications
You must be signed in to change notification settings - Fork 111
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
list.split-at should return a tuple #797
Comments
Maybe yeah, maybe no. Having mnemonically named |
I will argue that if we want only either
instead of:
seems to be better. But yes, this is a very low priority issue. |
For sure. In fact, a lot of libraries can now exploit tuples, now that they're here. Basically, any place where Common Lisp would have returned multiple values… |
I don't think we want to do that, necessarily, actually. Yes of course, if you only need one piece then you should use And who knows, hypothetically, I could easily see a |
I have a really frustrating moment of friction every time I use Naming is good, and tupling lets the user of a function easily pick their own names – even better! Remembering names is hard, and I think is good to avoid. Even in the object destructuring case, you have to remember the field names for every multiple-value-returning function, which is cognitive/memory overhead. |
So much wisdom in ^^this^^ comment. |
There are a lot of devil-in-the-details counterarguments to this, even when I agree with most of it. E.g., width-subtyping means you only need to bind the fields you care about, or intellisense improves the ergonomics of records, or having better/easier-to-use documentation to make finding field names easier. Yes, clearly, picking your own names can be better than remembering the ones we supply. But the additional burdens are (1) learning the tuple syntax (either binding or accessing), (2) choosing multiple good names, (3) remembering that a function returns a tuple that you're supposed to destruct in the first place. It's not an obvious immediate win to me. I expect the eventual pyret-IDE will be a lot more helpful for object-based APIs than tuple-based ones. And I think problems 1 and 2 will be turn-offs for a lot of novices, for whom extra punctuation and syntactic overhead of tuples will be more burdensome than looking up the documentation of a given API to find out its field names. So my point remains: I don't think we should skew all our APIs to use tuples just because we can. |
By the way, the new |
No description provided.
The text was updated successfully, but these errors were encountered: