On Tue, Nov 02, 2004 at 08:13:54AM +1300, Carl Cerecke wrote:
> >array ls=({ 1,2,3,4,5,6 });
> >array pairs=ls/2;
> >({ ({ 1,2 }), ({ 3,4 }), ({ 5,6 }) })
> List division! Very convenient feature. You can get list division in 
> python by subclassing list and defining the __div__ method (if you 
> really wanted to)

ah, interresting.
i already noticed that python 2.3 supports things like:
union = a & b
isect = a | b
diff = a ^ b

so if there is a method for every operator then python maybe could be extended
to support all of those to the extend that pike does. (one of the prides
of pike is that all operations work on all types)

> What is the story with those ({ and }) delimiters? They're quite 
> syntactically ugly, IMO.

well, you have to make a choice in syntax somewhere.
other grouping characters are already taken for other uses.
the advantage of these is that they are very easely spotted in the code.

you just know that ({ 1,2 }), ([ "foo":"b", "bar":"a" ]) and (< "foo", "bar" >)
are values and not some other language constructs.

> And possibly a lot of potential for getting the 
> pike parser thoroughly confused if you get them around the wrong way.

no. the code would simply not compile because of a parse error, and
you'd just slap your head once you see why. 
in practice, this is never an issue. 
(just like pythons indenting is not an issue, even though so many people
that never tried it love to complain about it)

greetings, martin.
-- 
              - Pike - Caudium - sTeam - psycMUVE - LPC -
     Pike Camp, October 13 - 19, 2004, Unperfekthaus, Essen, Germany
--
pike programmer   travelling and working in europe            open-steam.org
unix system-      is.schon.org                              camp.gotpike.org
administrator     bahai.or.at                       iaeste.(tuwien.ac|or).at
Martin B�hr       http://www.iaeste.or.at/~mbaehr/

Reply via email to