Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: (PR#8239) Speclist generator
Home

[Freeciv-Dev] Re: (PR#8239) Speclist generator

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8239) Speclist generator
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 23 Mar 2004 05:35:50 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8239 >

On Tue, Mar 23, 2004 at 03:55:51AM -0800, Per I. Mathisen wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8239 >
> 
> On Tue, 23 Mar 2004, Raimar Falke wrote:
> > You know that with your approach the localization of the types and
> > functions go away. Currently you can assume that if there is no
> > foolist.h file that this list type is declared in foo.h.
> 
> I don't understand. We don't localize (translate) types or functions??

Wrong word. I mean that all functions and types for a certain
object/class (like city) are all in the same file.

> > Can you cite a file which has 5+ list declaration in a single file?
> 
> Yes, I can. Want me to paste it? It isn't a freeciv file.

> As I explained in the first post,

Ohh I overread that.

> this problem does not arise in freeciv (yet).

There is the question if this case will eventually happen in
freeciv. So far I doubt this.

> > That we should ban macros and inline functions from the header files.
> 
> Then where do we put them?

Make all normal functions and put them in the .c file. And yes I
exclude things like iterate here which have to be macros.

> > Yes the cpp is used as a generator. It is the good natural choice
> > since it is portable, available and requires no extra time. You
> > yourself wanted to implement the packet generator with cpp.
> 
> Yes. And as you know, I failed.
> 
> Now we require python anyway, so we can just as well slide down the
> slippery... Err, no, I didn't say that.

The point remains that a python generator should IMHO provide some
advantage over a cpp solution.

> > > However, this clever hack does not work with macro or inline
> > > functions.
> >
> > Can you explain this in more detail?
> 
> It is a bit complicated. The core problem is that you can neither
> conditionally define a macro nor expand macros in a macro name.

Both are possible. See CHECK_MAP_POS and SPECLIST_PASTE. The latter
isn't beautiful but possible.

> I cannot give you a full account until I get back to my dev box.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "brand memory are for windows users that think their stability
   problems come from the memory"
    -- bomek in #freeciv




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