This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: OT Python stuff (was RE: Python in Xconq)


Oh,
In Perl, I just write:

@files = Find();
To get a list of all files in the current subtree.

But that's just me - there may be quicker ways to write it in Perl, as I
make no claims to be a Perl guru.

:)

Seriously, any OO language is preferred (IMHO), because it will be more
maintainable (C++?).

And a scripting language is seriously preferred, because it will permit
so much more stuff.

If we add a scripting language, then I would submit that we write a
simple porting script to convert GDL to that language, and drop GDL.
IMHO, GDL is just a way to fill in data-structures, and any language can
do that.

A nice GUI-builder (anything well-known & portable like TCL) would be
very useful, because the scripting language could then create new popups
as needed, and if we're aiming for flexibility, then people who do
political games are going to have lots of popups saying "Country X has
proposed trading 3 steel, 4 oil and 5 herds of cattle, in return for a
peace treaty.
What is your answer?".

Might as well get all the flexibility there...
And that sort of thing is something that no other game-builder program
has, but shouldn't be that hard to add to Xconq.

Erik


-----Original Message-----
From: xconq7-owner@sources.redhat.com
[mailto:xconq7-owner@sources.redhat.com] On Behalf Of Mark A. Flacy
Sent: Tuesday, November 18, 2003 5:30 AM
To: 'xconq'
Subject: OT Python stuff (was RE: Python in Xconq)

>>>>> "Erik" == Erik Jessen <ejessen@adelphia.net> writes:
Erik> 
Erik> Perl has all that as well - I know, because I use them on a
regular
Erik> basis.  Also, there are a great many modules others have written,
to
Erik> enable things like network play (RPC/IPC/IRC/etc.).
Erik> 
Erik> But again, I've not seen Python, so it may do all those things in
a
Erik> much nicer way.

My running joke is that Python has a very simple syntax while Perl has a
shitload of syntaxes.  If you know C, C++, or Java, you won't find very
many syntax surprises in Python.  You can write a lot of code without
using
any of the Python "odd" constructions.

Even so, you can write such gems as...

dirList = [ [k , v] for (k, v) in tmap.iteritems()]

...which converts a hashmap of tuples into a list of lists or ...

        webClientDirs = [os.path.join("com", "mycompany", "argle",
"cap", "web", "ua", "base", "session"),
                         os.path.join("com", "mycompany", "argle",
"cap", "web", "ua", "pca", "appl"),
                         os.path.join("com", "mycompany", "argle",
"foundation", "awt", "layout"),
                         os.path.join("com", "mycompany", "argle",
"base", "ccpe", "base"),
                         os.path.join("com", "mycompany", "argle",
"base", "ccpe", "events"),
                         os.path.join("com", "mycompany", "argle",
"base", "ccpe", "model"),
                         os.path.join("com", "mycompany", "argle",
"base", "ccpe", "type"),
                         os.path.join("com", "mycompany", "argle", "mw",
"gui"),
                         os.path.join("com", "mycompany", "argle", "mw",
"sdp", "jni"),
                         os.path.join("com", "mycompany", "bargle",
"base")
                         ]
        
        fulldirs = map(lambda x: os.path.join(self.config.compileDest,
x), webClientDirs)

...which created a list of subdirectories (in a cross-platform fashion)
and
then prepends a root directory to each element of the list producing
another list for later processing.

http://www.linuxjournal.com/article.php?sid=3882 is written by the guy
that
wrote fetchmail.  Worth a read.


-- 
 Mark A. Flacy
 Any opinions expressed above are my own.  Any facts expressed above
 would imply that I know what I'm writing about.  Sometimes, I do!
"Just because you're paranoid doesn't mean they aren't out to get you
 anyways."




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]