Re: macros, was Looking for volunteers for XL

jgk@panix.com (Joe keane)
Thu, 15 Dec 2011 15:40:05 +0000 (UTC)

          From comp.compilers

Related articles
Looking for volunteers for XL christophe@taodyne.com (Christophe de Dinechin) (2011-11-22)
Re: Looking for volunteers for XL kaz@kylheku.com (Kaz Kylheku) (2011-12-01)
Re: Looking for volunteers for XL jgk@panix.com (2011-12-13)
Re: macros, was Looking for volunteers for XL kaz@kylheku.com (Kaz Kylheku) (2011-12-13)
Re: macros, was Looking for volunteers for XL kaz@kylheku.com (Kaz Kylheku) (2011-12-14)
Re: macros, was Looking for volunteers for XL jgk@panix.com (2011-12-15)
Re: macros, was Looking for volunteers for XL kaz@kylheku.com (Kaz Kylheku) (2011-12-16)
| List of all articles for this month |
From: jgk@panix.com (Joe keane)
Newsgroups: comp.compilers
Date: Thu, 15 Dec 2011 15:40:05 +0000 (UTC)
Organization: Public Access Networks Corp.
References: 11-11-048 11-12-002 11-12-017 11-12-018
Keywords: macros, design
Posted-Date: 16 Dec 2011 00:48:22 EST

Kaz Kylheku <kaz@kylheku.com> wrote:
>Problem is, you're creating something akin to an assembly language,
>with instructions that have source and destination operands.


So it looks like... an imperative programming language!


Some typical code:


        int f(struct foo *foo)
        {
...


err = foo_get_bar(foo, q, &bar);
if (err != 0)
...


err = bar_get_box(bar, p, &box);
if (err != 0)
...


...


err = box_frobnz(box, z, &a);
if (err != 0)
...


if (soanso)
{
err = box_grobny(box, y, &b);
if (err != 0)
...
}


...
        }


The version with macros will look exactly the same, except you can omit
the '&', and they're usually upper case.


>The need for generating temporary variables has not gone away.


I think this is not a big deal, since the value is often then used more
than once. Even if not, the code may be more clear, if less concise.
[also helps debugging]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.