Re: Issue 3436 in pharo: #copyFrom: is broken

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Issue 3436 in pharo: #copyFrom: is broken

pharo

Comment #21 on issue 3436 by [hidden email]: #copyFrom: is broken
http://code.google.com/p/pharo/issues/detail?id=3436

Love Cesar comments.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 3436 in pharo: #copyFrom: is broken

pharo

Comment #22 on issue 3436 by [hidden email]: #copyFrom: is broken
http://code.google.com/p/pharo/issues/detail?id=3436

Love Cesar comments.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 3436 in pharo: #copyFrom: is broken

pharo

Comment #23 on issue 3436 by [hidden email]: #copyFrom: is broken
http://code.google.com/p/pharo/issues/detail?id=3436

IMHO, modifying a collection in place is and should remain an exception,  
and restrict to the well known and explicit
- #add: #addAll: and variations
- #remove: #removeAll: and variations
- #replaceAll:with: #replaceFrom:to:with: and variations
- #at:put: atAll:put: and variations.

There has been also some recent additions #replace: and Squeak-only  
#reverseInPlace.
These ones are less explicit though kind of imperative: #sort #sort:  
#shuffle #shuffleBy:

There is also String class>>#translate:from:to:table: which modifies its  
first argument...  Used only as an optimization of asUppercase, asLowercase.
Same for collect:into:.

My feeling is that keeping as many core objects as possible stateless and  
functional-language like is the best we can do wrt complexity.

Stateful operations should be restricted to things like IO (streams) or UI.

I once proposed to introduce self-modifying Point and Rectangle methods for  
the sake of speed, and I am still amazed how soft the reactions were, this  
sacrilege should have been anathematized!

So, the copy or not copy discussion is null and void IMO - at least until  
we introduce lazy operations and start mixing stateful with lazy...
The discussion about naming consistency is valuable though, but standards,  
cross-dialect and history counts too...
Since Pharo puts more weight on consistency than backward compatibility,  
deprecating copyFrom: -> copyStateFrom: should be considered seriously...


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 3436 in pharo: #copyFrom: is broken

pharo

Comment #24 on issue 3436 by [hidden email]: #copyFrom: is broken
http://code.google.com/p/pharo/issues/detail?id=3436

Yes I like the copyStateFrom: message because it is really clearer.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 3436 in pharo: #copyFrom: is broken

pharo

Comment #25 on issue 3436 by [hidden email]: #copyFrom: is broken
http://code.google.com/p/pharo/issues/detail?id=3436

Then lets make the renaming/deprecation in 1.4, and potentially reintroduce  
copyFrom: as short-hand on SequenceableCollection in 1.5?
That way, there is at least one version where any current users (even of  
Collection copyFrom:) will at least get warnings rather than unexpected  
behaviour.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 3436 in pharo: #copyFrom: is broken

pharo

Comment #26 on issue 3436 by [hidden email]: #copyFrom: is broken
http://code.google.com/p/pharo/issues/detail?id=3436

#copyStateFrom: is redundant. If not state, what other thing it could copy?

There is a reason (an intuitive one) why everybody (other dialects) are  
using #copyFrom: like that. And chances are, Pharo is the first thing  
newcomers will experience.

We really need to decide if we want to show modesty (or at least respect)  
for their* intuition.

Or... endanger ourselves in raising even more entry barriers and paying the  
price of not doing it.

Just to refresh your memory (no need to read it all once again) just take a  
look at the definition of the principles and thing for a minute on how are  
we doing, and if you want to read even less, just the 2 first sentences  
will do:
http://www.cs.virginia.edu/~evans/cs655/readings/smalltalk.html

* "they" are not specialists, they are, if we're lucky, "wanna be  
specialist"


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker