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: Reinier Post <rp@xxxxxxxxxx>
Cc: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC PATCH] init_techs
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 9 Oct 2001 18:19:00 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Oct 09, 2001 at 05:08:23PM +0200, Reinier Post wrote:
> 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.

You can all manage with three commands create, set and delete. I would
like a distinction between creating instances and modifying values. So
in the purest principle there is an empty constructor: create and all
data is filled in with set methods.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Transported to a surreal landscape, a young girl kills the first woman
  she meets and then teams up with three complete strangers to kill again."
    -- TV listing for the Wizard of Oz in the Marin Independent Journal


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