Python Strings

Jonadab the Unsightly One jonadab at bright.net
Wed Sep 6 05:51:04 EDT 2000


Erik Max Francis <max at alcyone.com> wrote:

> That's sort of the flip side of weakly-typed languages; if they're
> weakly typed then you have to play games when you _do_ need to know the
> type of an object.

I guess that I would still consider a language sufficiently
"loosely typed"[1] if you can always determine the type of 
an item, as long as you can proceed to assign an entirely 
different item to the same variable a moment later.  So 
actually, it's the *variables* that I want to be loosely 
typed, not the language or the objects per se.  (In fact
I really prefer to be able to get the metaclass of an
item when I want to know.)

What I really like is the ability to have an object
automatically do the appropriate thing with what you
give it, regardless of what kind of thingy that is.
This is only possible when you can give it any kind
of thing that might be appropriate.  And in the general
case, that means you have to be able to give the object
any kind of thing there is -- a routine, a string,
a number, or whatever -- and have it be able to know 
what it has (if it needs to know; sometimes it 
doesn't need to know, of course, if it's only passing
the thingy on to some other object).

In other words, I'm hoping Python has a much-improved
equivalent for ZRegion.  Inform would be better if
ZRegion (or metaclass) could return a value indicating
"it's an integer" when that's what it is.  This is
impossible with integers, dictionary words, properties,
attributes, actions, and assorted other things.  
Fortunately you MOSTLY only need it for strings,
routines, and objects.  But there's always that 
occasion when it'd be nice to do the same thing
with one of those other types.  (Glulx improves
on this somewhat, I think...)

[1]  In the same sense that I say, "I like my languages
     to be loosely typed".  

- jonadab



More information about the Python-list mailing list