🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #296

Re: Reserved names in ANSI C

#296
From: Norman Diamond
Date: Thu, 06 Jul 1989 05:04
36 lines
2451 bytes
In article <461@algor2.UUCP> jeffrey@algor2.UUCP (Jeffrey Kegler) writes:

>The only real solution to this problem is something like the renaming
>facility that was allowed in ADA.

(Ada and a few other languages.)

>That is, suppose you are using one
>person's window manager library, and the patented WhatchaMacallit
>database.  Both use names all carefully prefixed with WM_ to prevent
>conflicts.  The only way to prevent conflicts like this is to license
>library writers, which solution is far worse than than (admittedly
>nasty) problem.  And here both library writers have tried to be
>careful, at the expense of readability.  They left themselves exactly
>three characters in which their external names must be distinct.
>(They could try numbering them, WM_000, WM_001, etc.) :-)

No :-) is needed.  Cobol programmers have known this solution for a
long time, and the length of distinct characters wasn't even the reason.
Names should indeed be numbered:

WM_000_long_descriptive_name
WM_001_another_long_descriptive_name
WM_002_yaldn  /* i guess this one wasn't so long :-) */

Yes, renaming is still necessary to deal with several libraries that
unfortunately chose the same prefix.  Yes the only other solution,
licensing, would be worse than the problem.  But no one would obey
the licensing requirement anyway -- because the licence might prohibit
them from defining __STDC__ as 0.

--
Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net)
 The above opinions are claimed by your machine's init process (pid 1), after
 being disowned and orphaned.  However, if you see this at Waterloo, Stanford,
 or Anterior, then their administrators must have approved of these opinions.
Technical Details
Message-ID: <10496@socslgw.csl.sony.JUNET>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond!diamond
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk> <13680@haddock.ima.isc.com> <1598@cbnewsh.ATT.COM> <875@cbnewsl.ATT.COM> <316@mountn.dec.com> <884@cbnewsl.ATT.COM> <321@mountn.dec.com> <461@algor2.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond!diamond
From: diamond@diamond.csl.sony.junet (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: Reserved names in ANSI C
Message-ID: <10496@socslgw.csl.sony.JUNET>
Date: 6 Jul 89 05:04:32 GMT
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk> <13680@haddock.ima.isc.com> <1598@cbnewsh.ATT.COM> <875@cbnewsl.ATT.COM> <316@mountn.dec.com> <884@cbnewsl.ATT.COM> <321@mountn.dec.com> <461@algor2.UUCP>
Sender: news@csl.sony.JUNET
Reply-To: diamond@csl.sony.junet (Norman Diamond)
Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan
Lines: 36