From: Robert Dober Date: 2006-09-12T17:19:51+09:00 Subject: Re: string as nil or empty string? ------=_Part_15915_20038533.1158049157396 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/12/06, Rimantas Liubertas wrote: > > <...> > > I wonder for a long time about the concept of having a value indicating > the > > absence of a value. > > I think the conecpt is flawed -useful- but flawed. > <...> > > What alternatives do we have? You read me very well, we might not have any, still I think it is flawed like as our perception we can put into the modelling process a programming language is, might be too limited yet. For me it is perfectly natural. > In natural languages we have words which denote nothingness, Yep, but see what is behind it, shall we use nil for nothingless or defaults or undefined values or place holders or nil, please do not forget that nil comes from a very specific meaning, but maybe we jus= t *shall* forget that. why can't we have objects for the same purpose in programming languages? objects by all means, we need objects in Ruby there is nothing else, but maybe nil is not the object semantically behaving correctly to model e.g. nothinglessness c.f. my None implementation above I feel that if nil models the absence of a value (which it does not quite accurately) maybe it should not model other things and we should be more creative ourselfs when using nil. Maybe we should also have the possibility (as in Python, sorry I said the word) to define objects that evaluate to false like e.g. x evaluates to false in boolean context if one of the three conditions is met (1) x.respond_to?(:I_have_no_idea_maybe_true_value?) && x.true_value? meets conditions (1???) (2) or (3) (2) x=3D=3Dfalse (3) x.nil? anyway please note that these are ideas, feelings not concrete ideas and fo= r sure no rules ;) Regards, > Rimantas > -- > http://rimantas.com/ > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_15915_20038533.1158049157396--