[Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset
[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: commandline syntax and semantics (was: Server/ruleset unification) |
From: |
Arien Malec <arien_malec@xxxxxxxxx> |
Date: |
Mon, 1 Oct 2001 15:44:33 -0700 (PDT) |
First, just to be clear, all my examples are about object types, not instances.
So when I wrote "unit.archers" I should have written "units.archers"
In sum, our disagreement is: I would create a new identifier to refer to
advances, etc., whereas you would use name_orig. Not much difference, and I
won't argue if the consensus of the list is for name_orig rather than a new
identifier.
It seems like the consensus of the list is to invest some work to make the
lexer/parser flexible enough to support multi-attribute set/creates, and to use
some kind of braces/parens to group the attributes being set.
Arien
--- Reinier Post <rp@xxxxxxxxxx> wrote:
> Yes, but I presented a system for quoting that would be easy to parse:
> quote by surrounding with " ", and make "" stand for " within " "s.
> You do have to keep track of whether you're within quotes or not.
> It can be made obligatory to quote names.
I agree that it can be done, but I think it's simpler to introduce an object
indentifier. If we go your way, it should be obligatory to quote names.
> > 2) See the following set of commands:
> >
> > ; in the ruleset:
> > create unit.archers
>
> I still don't know what unit.archers is - a variable declaration
> for the variable with the name 'archers' freely chosen by the user?
> In that case using the . notation here is very confusing; declarations
> are usually done like this:
Again, I intend the above command to mean "create the unit type archers"
> > ; on the command-line, my semantics
> > set unit.archers.name = "Bowmen"
> > set unit.archers.hitpoints = ...
> >
> > ; on the command-line, your sematics
> > set unit.archers.name = "Bowmen"
> > set unit.bowmen.hitpoints = ....
> > ; Does unit.archers still exist now?
>
> unit.archers doesn't identify anything now; the created object can
> now be referred to as unit.bowmen, unless there was already a unit
> with that name.
>
> BTW the example is really about unit_types rather than units,
> so my syntax would actually be:
>
> create units.archers # automatically gets name "Archers" assigned
> set units.archers.name = "Bowmen"
> set units.bowmen.hitpoints = ...
>
> and the mechanism is different: you introduce and use a variable name,
> I do not.
I introduce an identifier to refer to the unit.
If I'm playing in a French locale, does units.archers.name = "Bowmen" set the
English or the French title? I assume the English?
[...]
> Brackets can also be used (a la Pascal's WITH) to allow local
> abbreviations for set commands:
>
> set techs."Atomic Theory" {
> req1= ...
> req2= ...
> name = "Atomic Enegry Technology"
> }
>
> This way you don't need any variables at all. The set and create
> syntax is identical; the only difference would be that 'create'
> requires the indicated object to be new, while 'set' requires it
> to exist already.
If we force the bracket to be introduced on the same line as the create/set
command, we can even do away with terminating commands with ";", as the
presence of the bracket will force the lexer/parser into a "read till
terminator" mode.
__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Arien Malec, 2001/10/01
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel L Speyer, 2001/10/01
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/10/01
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/10/01
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification),
Arien Malec <=
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/10/02
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/10/02
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/10/02
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/10/27
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Daniel Sjölie, 2001/10/27
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/10/28
- [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Reinier Post, 2001/10/02
[Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification), Ross W. Wetmore, 2001/10/01
|
|