PHP vs. Python/comp.lang.php?

phil hunt philh at comuno.freeserve.co.uk
Fri Nov 23 13:52:04 EST 2001


On Fri, 23 Nov 2001 20:36:10 +0300, Oleg Broytmann <phd at phd.pp.ru> wrote:
>On Fri, Nov 23, 2001 at 04:41:55PM +0000, phil hunt wrote:
>> PHP is also ugly. As an example, compare: 
>> 
>> PHP:     $object->$member
>> Python:  object.member  
>
>   Unfortunately, latest versions of Python have its own gotchas.
>"; ".join([a.id for a in listIds() if a.b > x])
>   looks worse than PHP, it looks almost like perl :(

I like Smalltalk syntax here, where you can say things like:

    a1 := SomeClass listIds select: [ :a | (a at: #b) > x]
    a2 := a1 collect: [ :a1m | a1m at: #id ] 

Which AFAIK is an approx translation of the [...] part of the python
expression above (it's a long time since i did Smalltalk so I may
be wrong).



-- 
*** Philip Hunt *** philh at comuno.freeserve.co.uk ***




More information about the Python-list mailing list