Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11877

Re: Equates or Synonyms?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Equates or Synonyms?
Date Mon, 28 Nov 2011 17:35:57 +1300
Lines 42
Message-ID <9jghddF4d0U23@mid.individual.net> (permalink)
References <MPG.293c70af3b85a5c09896d0@news.eternal-september.org> <jauosu$efo$1@dont-email.me> <MPG.293cb9d8c4425bd79896d1@news.eternal-september.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net dvr91oy7H3PUh0lIU+nVxwZZp8OVC6kxMnJpHlQkUvNLAwzpPR
Cancel-Lock sha1:9TEan6iKX++L1ybrIkE/UOkS0bo=
User-Agent Mozilla/5.0 (X11; SunOS i86pc; rv:6.0.2) Gecko/20111003 Thunderbird/6.0.2
In-Reply-To <MPG.293cb9d8c4425bd79896d1@news.eternal-september.org>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:11877

Show key headers only | View raw


On 11/28/11 05:19 PM, Mike Copeland wrote:
>>> capability to "equate" or use a synonym for
>>> an identifier?
>>
>> Yes, but it depends on the kind of identifier.
>> References work for v
>    ^^^^^^^^^^^^^^^^^^^^^
>     I don't understand what you mean here.
>
>>>   I have the following declaration:
>>> struct DEF_STRUCT
>>> {
>>>       int      EPace;               // event maximum pace
>>>       int      TFCount;             // Total Finishers Counts
>>>       short    ADepth;              // Awards Depth
>>>       short    SFMales, SFFemales;  // Skipped Finishers
>>>       unsigned short dbeMales, dbeFemales;
>>>       unsigned short finMales, finFemales;
>>>       unsigned short prtMales, prtFemales;
>>>       float    EDist;               // event distance in miles
>>> [etc.]
>>> } ;
>>> and I'd like to "reuse" some of the names (such as EPace or ADepth) with
>>> different identifiers.  That is, in some of my programs where I have
>>> this structure declared I'd like to use a different name for, say,
>>> EPace, because I'm not actually using that data element in that
>>> particular application.
>
>> Why do you want a different name when you're not using it?
>> The simplest solution is then to ignore the name.
>> After all, you're not using it.
>
>     I only want to use a more descriptive name for the variable in the
> application code.  I want to maintain _some_ level of useful
> documentation in my code...

Then don't bother with the name of type, just give the variable a better 
name.  Try "eventMaximumPace" rather than "EPace".  Also heed Alf's 
advice about mixing naming convections!

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 16:07 -0700
  Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-28 12:50 +1300
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 21:21 -0700
  Re: Equates or Synonyms? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-28 02:41 +0100
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-27 21:19 -0700
      Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-28 17:35 +1300
        Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 16:03 -0700
          Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-29 12:52 +1300
            Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 22:00 -0700
              Re: Equates or Synonyms? Ian Collins <ian-news@hotmail.com> - 2011-11-29 18:13 +1300
              Re: Equates or Synonyms? ralph <nt_consulting64@yahoo.net> - 2011-11-28 23:21 -0600
              Re: Equates or Synonyms? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-29 12:10 +0000
      Re: Equates or Synonyms? Paavo Helde <myfirstname@osa.pri.ee> - 2011-11-28 01:40 -0600
      Re: Equates or Synonyms? Stuart Redmann <DerTopper@web.de> - 2011-11-28 02:38 -0800
    Re: Equates or Synonyms? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-28 13:24 +0000
  Re: Equates or Synonyms? "Paul" <pchrist<nospam>or@yahoo.co.uk> - 2011-11-28 19:21 +0000
    Re: Equates or Synonyms? mrc2323@cox.net (Mike Copeland) - 2011-11-28 16:14 -0700
      Re: Equates or Synonyms? Kalle Olavi Niemitalo <kon@iki.fi> - 2011-11-29 09:01 +0200

csiph-web