-
Notifications
You must be signed in to change notification settings - Fork 11
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
Should String substringFrom:to: check indexes? #39
Comments
The people implementing it may have had different trade offs in mind. SOM is suppose to be simple. Simple comes in some places with compromises on "doing the perfect thing", when it complicates matters. As you have seen already in multiple cases. It might also be the Smalltalk way of doing things... don't know. Though, I am happy to have those things fixed up step by step. |
Do you have a suggestion for what you might like to see? |
First step would be to have the same semantics as the method, simply implemented in the primitive, I suppose. Not sure what else there would be to do. Though, and you'll love that: the semantics around which classes can be subclassed aren't exactly consistent in the various implementations. So, the handler may not be very useful in practice. |
I guess my question is slightly different. There are lots of SOMs: can one change the library without changing all of them? I think the answer is "no" as you recently added primitives that I think only Java SOM implements? But maybe I'm wrong! |
All SOMs I am maintaining link to a specific version of a library, so, there's no direct negative impact of changing the library. However, the library is tested with some of those SOMs (https://travis-ci.org/github/SOM-st/SOM), and I am generally aiming to have them all support the latest version. And, this is work, yes... |
Understood. I'm definitely not in the situation (for various different definitions of "situation") where I want to take the burden of evolving any SOM except yksom, so I shall shut up on this topic! |
Nah, don't. Especially, don't feel obliged to actually provide fixes. |
Point taken. I will do my best to try not to raise things which are partly matters of taste though. |
At the moment
substringFrom:to:
is implemented thus:which feels unidiomatic because:
primSubStringFrom:to:
can not recheck those indexes, since any old Tom, Dick, or Harry can callprimSubStringFrom:to:
with whatever arguments they want.Array at:
do not have aprimAt
variant (i.e. the VM is expected to check the indexes).I was expecting this part of the library to just be
substringFrom:to: = primitive
-- perhaps we can simplify (and speed up!) this code by doing so?The text was updated successfully, but these errors were encountered: