🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #54

Re: Simple preprocessor

#54
From: David Adrien Tanguay
Date: Tue, 21 Jul 1992 18:30
21 lines
1579 bytes
darcy@druid.uucp (D'Arcy J.M. Cain) writes:
>dat@thinkage.on.ca (David Adrien Tanguay) writes:
>>darcy@druid.uucp (D'Arcy J.M. Cain) writes:
>>>Macros can take arguments and defaults can be specified for the arguments.
>>>    @DEFINE foo bar $(1:zap)
>>>    $(foo:goo)    ==>     bar goo
>>Why a separate character '$'? I.e., why not @(foo)?
>
>I hadn't really given it a lot of thought.  I suppose I was copying make
>and shell in this regard.  However, pretending that I have given this some
>thought, the answer is so that a macro used at the start of a line doesn't
>get confused with a preprocessor directive.  Do you have a strong reason
>why not a separate character?

Not really, just one less character to have to escape, one less variant
international glyph to worry about. C may not use $, but other texts may.
I infer from your reason that the '(' after the '$' is optional (in some
contexts): i.e., $foo will expand the foo macro. I had thought otherwise.
-- 
David Tanguay       dat@Thinkage.on.ca  dat@Thinkage.com  uunet!thinkage!dat
Thinkage, Ltd.           Kitchener, Ontario, Canada          [43.40N 80.47W]
Technical Details
Message-ID: <1992Jul21.183044.22776@thinkage.on.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!watserv1!watmath!thinkage!dat
References: <1992Jul17.232621.20226@druid.uucp> <1992Jul18.170227.20219@thinkage.on.ca> <1992Jul20.172457.20496@druid.uucp>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!torn!watserv1!watmath!thinkage!dat
From: dat@thinkage.on.ca (David Adrien Tanguay)
Subject: Re: Simple preprocessor
Message-ID: <1992Jul21.183044.22776@thinkage.on.ca>
Organization: Thinkage, Ltd.
References: <1992Jul17.232621.20226@druid.uucp> <1992Jul18.170227.20219@thinkage.on.ca> <1992Jul20.172457.20496@druid.uucp>
Date: Tue, 21 Jul 1992 18:30:44 GMT
Lines: 21