Why does python not have a mechanism for data hiding?
Bruno Desthuilliers
bruno.42.desthuilliers at websiteburo.invalid
Mon Jun 9 04:59:53 EDT 2008
Russ P. a écrit :
> On Jun 8, 5:40 am, Mark Wooding <m... at distorted.org.uk> wrote:
>> Russ P. <Russ.Paie... at gmail.com> wrote:
>>> The idea of being able to discern properties of an object by its name
>>> alone is something that is not normally done in programming in
>>> general.
>> Really? You obviously haven't noticed Prolog, Smalltalk, Haskell, ML,
>> or Erlang then. And that's just the ones I can think of off the top of
>> my head.
>>
>> * Prolog and Erlang distinguish atoms from variables by the case of
>> the first letter; also `_' is magical and is equivalent to a new
>> variable name every time you use it.
>>
>> * Smalltalk distinguishes between global and local variables according
>> to the case of the first letter.
>>
>> * Haskell distinguishes between normal functions and constructors
>> (both data constructors and type constructors) by the case of the
>> first letter, and has Prolog's `_' convention.
>>
>> * ML allows a single-quote in variable names, but reserves names
>> beginning with a single-quote for type variables. It also has
>> Prolog's `_' convention.
>>
>> As far as I can see, discerning properties of a thing from its name
>> seems relatively common.
>
> Well, "common" in Prolog, Smalltalk, Haskell, ML, and Erlang is hardly
> common in general. I'll bet that Java and C/C++ are used more in North
> Dakota than all those languages combined are used in the entire world.
And you'll very probably loose.
> That's not to say they aren't interesting academic languages, of
> course.
Erlang an "academic" language ? Man, you're either a troll or totally
clueless.
More information about the Python-list
mailing list