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

[Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Arien Malec <arien_malec@xxxxxxxxx>
Cc: rf13@xxxxxxxxxxxxxxxxxxxxxx, Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Server/ruleset unification [Was [RFC PATCH] init_techs]
From: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Date: Tue, 25 Sep 2001 21:02:10 -0400 (EDT)

On Tue, 25 Sep 2001, Arien Malec wrote:

> 
> --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > Can you show some examples of simple_set_statement and
> > object_set_statement. IMHO should these two be unified. So
> > 
> >  set players Caesar ailevel hard; OR
> >  set players.Caesar.ailevel=hard;
> > 
> > should be use the same syntax as a
> > 
> >  set unit archer vison 2; OR
> >  set unit.archer.vision=2;
> 
> simple_set_statement is intended for toplevel attributes:
> 
> set huts 0;
> set ailevel hard;
> set min_dist_bw_cities = 4;
> 
> object_set_statement in the trivial case looks like this:
> 
> set unit archer vision_range 2;
> 
> And, as you say, can be re-expressed as:
> 
> set unit.archer.vision_range 2;
> 
> so that it follows the simple_set_statement syntax.
> 
> But, in the complex case it looks like this:
> 
> set unit archer
>       name = "Longbowmen"
>       vision_range 2,
>       hitpoints = 15;
> 
> I.e., like the object create syntax, the object spec creates a context for
> later attribute setting. We can do away with any of the complex attribute
> setting by making the set statement always simple, using the dotted syntax for
> object references, and separating create and attribute settings. So
> 
> create tech atomic_theory
>       name     = _("Atomic Theory"),
>       req1     = "Theory of Gravity",
>       req2     = "Physics",
>       flags    = "";
> 
> becomes:
> 
> create tech.atomic_theory;
> set tech.atomic_theory.name _("Atomic Theory");
> set tech.atomic_theory.req1 = "Theory of Gravity";
> [etc.]
> 
> The complex syntax is nicer to read, IMHO, but it may be desirable to go with
> the simpler syntax.

How about:

create tech atomic_theory
with tech atomic_theoury
set name _("Atomic Theory")
set req1 "Theory of Gravity"
set req2 "Physics"
endwith

This is almost as brief as the brief form above, and is more general,
while still meeting the general command syntax.  It could be compressed by
combining the first two lines (maybe with braces?) or by changing the
TI-EOS-like endwith to a bashish htiw.

Just some thoughts

--Daniel Speyer
"May the /src be with you, always"



> 
> Note that either syntax requires that the identifier name (atomic_theory) be a
> proper identifier, and not a name ("Atomic Theory") (or an id).
> 
> Arien
> 
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
> http://im.yahoo.com
> 
> 



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