A collection of articles, ideas, and rambling from a guy who wrote some software that one time.

Friday, February 04, 2005

I rarely know what I'm talking about...

... but I know somebody who does.

A question worth asking: why does Python have an "integer" type, but no "character" type? Especially when the serious users of numbers in python enhanced it, they did everything in terms of arrays.

4 comments:

jerub said...

I am trying to figure out how python would be a better language if it had a 'character' type.

I can not figure that out.

glyf said...

I'm saying the opposite - Python might be better if it did not have an 'integer' type :-).

kragen said...

Yeah, I wonder why that innovation of APL's never caught on? It's obviously unsuitable for C, whose whole point was that it mapped closely to assembly on common CPUs, but you'd think higher-level languages would have picked it up at relatively low cost. I'm not sure what the resulting language would look like, though.

glyf said...

Well, in Python, you type '"X"' and get (in effect) array('c', 'X', readonly=True). Why not type '5' and get array('i', [5], readonly=True) ? + could just as easily dispatch on the type of array, and give you the right thing for '3 + 4'...

It doesn't seem like it'd change the language that much in terms of daily usage, although I am sure there are lots of subtle details that would take a few weeks to hammer out.