Complete.Org: Mailing Lists: Archives: freeciv-dev: October 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-dev@xxxxxxxxxxx (Freeciv developers)
Subject: [Freeciv-Dev] Re: [RFC PATCH] init_techs
From: Reinier Post <rp@xxxxxxxxxx>
Date: Tue, 9 Oct 2001 17:08:23 +0200

On Fri, Oct 05, 2001 at 06:07:26PM +0200, Raimar Falke wrote:

> > 3) There is some disagreement about whether the English name or a new
> > identifier should be used to identify techs/nations/etc., with a slight 
> > leaning
> > towards a new identifier (2 out of 3)

I think both are good, as long as they are easily distinguishable.
 
> From a mail from you:
> > 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.
> 
> I think that both aren't good. Because: the namespace of name_orig and
> of the identifier is different. The first one will allow almost all
> strings while the latter will restrict this. For example what
> identifier will be created from "A.Smith's Trading Co." at least the
> '.' and maybe also the '\'' and ' ' have to be converted:
> "A_Smith_s_Trading_Co_". All lowercased: "a_smith_s_trading_co_". What
> happens if there if a "A. Smith" and a "A' Smith" improvement.

I think you want a generic way of abbreviating names and using them to
identify objects with that name, based on what is already supported for
players (case-insensitive smallest unambiguous prefix).  Ignoring
all non-alphanumerics can be added as a feature.  This is going to
be ambiguous even if the exact names are unique, so ambiguity
must be dealt with, with an error.

> I propose that the identifier doesn't depend on any actual data. The
> identifier is choosen by the user and is used only for identifying a
> certain object. The identifier won't change after the object has been
> created. This is much like the current
> "[building_asmiths_trading_co]".

Yes, except that the user gets to choose an arbitrary name.

What if the same identifier is declared twice?
I think it's important to create an imperative language, i.e. the
specifications are incremental, overriding any earlier specifications.
That makes it much easier to load rulesets twice or modify them on the
server command line.

> Maybe I didn't understood it correctly and you mean that the
> identifier is more like a variable than an id. Than you could do
> things like:
>  a=create tech (...);
>  b=a; // assume deep copy
>  set b.name="asdda";
> and
>  a=create tech (...);
>  a=create tech (...); // oops we losse the first one

Overriding earlier values seems the only semantics that is easy to
implement and easy to understand.

>       Raimar

-- 
Reinier


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