Dr.Ruud wrote: > Rob Dixon schreef: > >> Please try to quote relevant parts of the posts you respond to >> in future. > > I did, and I always do, and I'm proud of it. :)
I think that is a matter of opinion, and mine is that you do not. For instance, no one has any idea what I said to prompt this sentence. In particular, you wrote > I am not sure which of the above you consider not true, so I'll show it > with a variant of your own code. without there being any 'above'. Now then. What isn't true about what you wrote? > Next time you write "That is not true.", be specific! I felt I had no need to be specific as you appeared throughout not to understand the values associated with scalar variables. These are some of the things you said > There is no real way to test if a value inside a variable has a numeric > "personality". Variables can have multiple "personalities", each with there > own binary value. A scalar cannot have multiple 'personalities' - it can have a maximum of two (its inherent type and a string equivalent) at any one time, but usually has only one. It will be given an additional string value only if it needs one for some reason. This is one reason why quoting variables - "$val" - is a bad idea in general, because it both forces conversion and occupies memory unnecessarily. There is indeed a simple way to test in Perl whether a scalar value is being treated as a string (I'm sure this is one or Randal's, but I can't find the reference) print "Non-string" if ($val & ~$val) eq '0'; And also, since Data::Dumper does it there clearly is a way for a module to do it in general. > It is not "in number data type", it is merely available as numeric. (as > I have said before) The specific example, had you chosen to quote it, was indeed "in number data type", as I said in my earlier post. > That Data::Dumper prefers to print the numeric face of the variable, if > available, is a matter of choice inside the code of Data::Dumper. Not in the case you were talking about. There was only an integer value available, and Data::Dumper's choice was between using that value or altering the data was passed to it. > Maybe the other modules that you use, have Data::Dumper embedded? That's a bizarre proposition don't you think? It's far more likely that Language::Prolog::Yaswi use a couple of lines of C to check the status of scalar variables the same way that Data::Dumper does, especially as it already needs to contain C to access the SWI-Prolog library. Now I've been specific: all of those things were untrue. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/