Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [RFC PATCH] init_techs
Home

[Freeciv-Dev] Re: [RFC PATCH] init_techs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC PATCH] init_techs
From: Justin Moore <justin@xxxxxxxxxxx>
Date: Mon, 24 Sep 2001 01:20:31 -0400 (EDT)

> > I agree here.  There may be functions which take a variable number of
> > arguments (e.g. /givetech nation tech1 tech2 ...)  If the command parser
> > tries to parse too intelligently, it'll just get in the way of
> > unanticipated syntaxes.
>
> Again, my point is that there should be *a standard syntax* that is supported
> and enforced by the framework. If you need to extend the syntax, you extend 
> the
> framework *once*. Otherwise, you have scores of callbacks with scores of
> nonstandard syntaxes, and the poor user has to remember just which syntax a
> certain command provides.

   I'm not quite sure we're operating on the same page here.  The parsing
framework shouldn't enforce a standard command syntax.  The parsing code
should just parse the command and decide which callback to call.  The
actual per-command callback functions should do syntax-specific stuff.
The maintainers should enforce a standard syntax by not allowing commands
with an obscure or stupid syntax.

   And if a programmer wants to change what kind of data the callback uses
("Whoops, I want to be able to pass multiple strings to this function
instead of one int.") we don't want them to have to find three different
places to change the code.  They should only have to find the callback
function and change how that one function parses the string passed to it.
Simple.  Elegant.  Liberating.  The next generation of Freeciv command
parsing: so much heaping goodness you won't believe it's actually C.

   I need sleep.

-jdm

"You don't give blood then take it back again
 We're all deserving of something more"
 - "Grievance"

Department of Computer Science, Duke University, Durham, NC 27708-0129
Email:  justin@xxxxxxxxxxx



[Prev in Thread] Current Thread [Next in Thread]