Not sure where the convention first arose, but definitely not in Ruby. Scheme 
(1975)  used trailing ! for side-effect containing functions and ? for 
predicates. For example, see SICP [1].

[1] https://mitpress.mit.edu/sicp/full-text/book/book.html 


On Jun 22, 2014, at 09:13 , Ben Coman wrote:

> 
> There was a previous thread [1] that involved discussion of the naming 
> convention for methods doing "dangerous" in-place mutatation - e.g. 
> sort/sorted,  reverse/reversed -  and even though I now know there is such a 
> naming convention, its hard to keep track of which is which. 
> Now today I happened to be looking for the first time at some Ruby code and 
> came across their naming convention for "dangerous" methods of having a 
> trailing exclamation mark - e.g. sort/sort!, reverse/reverse! - which is 
> REALLY intuitive.  How extreme is it to wonder if Pharo might some day be 
> able to support such a convention?
> 
> [1] 
> http://forum.world.st/11635-Race-condition-in-SequenceableCollection-gt-gt-shuffle-td4709752.html
> 


Reply via email to