From: Mathieu Bouchard Date: 2006-03-25T14:00:24+09:00 Subject: Re: [PATCH] to_str, to_s and StringValue On Sat, 25 Mar 2006, Gerardo Santana G�mez Garrido wrote: > But while I was at it, I found only 7 references to to_str vs. 34 > references to to_s. > Only these objects implement to_str: The idea is to distinguish two kinds of conversion: to_s is for default conversion from some non-String to a String to_str is for conversion from some would-be-String to a String the latter is reserved for classes that are made to be used in place of Strings, when they need to be converted to true Strings (with nodetype T_STRING, so that they can be accessed as a character array in C). IMHO, this should be reserved to classes that implement all the same methods as String, but it isn't the case, and it isn't easy, as the String interface becomes ever more obese from 1.4 to 1.6 to 1.8 to 1.9 and some upcoming incompatible changes in 2.0. _ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t�l:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montr�al QC Canada