Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset
Home

[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: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Cc: Reinier Post <rp@xxxxxxxxxx>, Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: commandline syntax and semantics (was: Server/ruleset unification)
From: Daniel Sjölie <deepone@xxxxxxxxxx>
Date: Sun, 4 Nov 2001 02:23:42 +0100

On 2001-11-03 20:01:38, Daniel L Speyer wrote:
> On Sun, 4 Nov 2001, [iso-8859-1] Daniel Sjölie wrote:
> > On 2001-10-29 00:35:33, Reinier Post wrote:
> > > Do you really want to forbid
> > > 
> > >   /ai Napoleon
> > > 
> > > and allow only
> > > 
> > >   /ai players[5]
> > > 
> > > ?
> > 
> > Well, I don't think it should be supported directly in the
> > "ruleset-language"... I think it's really too specific...
> > 
> > Actually, now that I think about it... How hard would it be to actually
> > use a subset of (or very heavily inspired by) sql syntax? That would solve
> > our problems nicely I think... I've kind of written that of earlier because
> > it might be overly complex but maybe it really wouldn't be that hard...
> > It certainly would have a lot of advantages, right?
> > 
> > The convenient syntax above should be specific for the command line
> > server (no need for this in a gui-server) and _implemented_ _using_ the
> > "ruleset-language"... So that /ai Napoleon could become:
> > 
> > update players set ai=not ai where name="Napoleon"
> > 
> > Server commands should not be part of the language but there should be a
> > server command that would take a "ruleset-language" statement as
> > argument and execute it...
> > 
> > This would give the best of all worlds, wouldn't it?
> > Do you think it's too much?
> > 
> > Some people had allready begun coding, right? How much has been done
> > really?
> 
> I've started coding (though it's been a while since I did anything).  At
> present, I'm using a java-ish (javish?) syntax with some SQL-like features
> (or, I think they're SQL-like -- I haven't used SQL).  So, at present, /ai
> Napolean would be:
> 
> set players.Napolean.a1 1

It would be more complex since it's really ai_toggle_
The point that I see here and with the examples below is that you can't
both keep the language simple and clean and get convenient commands for
the server... I think the right way here is to make the language simple
and clean and then make convenient commands using this language but
otherwise free from language restrictions...

> or something similar.  With the implementation I've written, each
> datapoint has a freeform (string) key distinct from any of its members, so
> something like
> 
> rename players.Hitler Bismark
> 
> would be easy enough to add.  Where the tags and the names displayed
> should/shouldn't be the same is an issue I've avoided so far.
> 
> Something like the where construct you described would be possible (I sort
> of designed with it in mind).  I pictured a syntax like
> 
> with units {wherever {equals vision 2} {set vision 7}}
> 
> Some sort of defining-commands-in-command-language would be a nice thing
> to have.  I might picture something like
> 
> set ai {lambda {x} {...}}
> 
> but then, I've been using lisp recently ;).

Hehehe... Yes, lisp has its sides but I don't think it's what you want
to expose people who just want to change something in datasets to... :)

The "it's easy enough to add" thinking can be really dangerous I
think... I'd really prefer not to get a new language with like 50
commands that can be used freely in rulesets...

/Daniel

-- 
Now take a deep breath, smile and don't take life so seriously... :)


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