Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Show key headers only | View raw
Tim Rentsch <txr@alumni.caltech.edu> writes:
> Keith Thompson <kst-u@mib.org> writes:
>> Tim Rentsch <txr@alumni.caltech.edu> writes:
>> [...]
>>> An important phrase in what I said is "that provides no
>>> capability beyond what is fairly easily available otherwise".
>>> The math stuff doesn't fall into this category, whereas
>>> binary constants do.
>>
>> You assert that binary constants don't provide a capability that
>> is fairly easily available othrwise. I disagree.
>
> If what we're talking about is being able to write an integer
> constant in binary (aka base 2), the short macro definition I
> posted recently demonstrates that this can be done in standard C,
> without adding any new construct to the language. Defining such
> a macro can be done in a fairly obvious and straightforward way
> (the one I posted was a little bit clever, but it doesn't have to
> be that clever to be workable). What part of this don't you
> agree with?
I disagree that defining a macro that implements the equivalent of
binary constants is sufficiently obvious or straightforward.
Depending on how such a macro is defined, it might fail quietly if you
use it with the wrong number of digits.
If I'm reading code that uses such a macro, I have to spend time
understanding how the macro works. If the code seems to be behaving
incorrectly, an incorrect macro definition is one more possible cause to
investigate.
Different programmers will define different macros. Actually, most
programmers don't bother, because it's too much effort. Providing
binary constants as a language feature solves both problems.
[...]
> What I think you're saying is that you would rather use binary
> constants defined as a new language construct than one of the
> other options (such as the macro alternative) now available in
> standard C. I accept that this is an accurate statement of
> your preference, but it doesn't invalidate my assertion that
> the ability to write constants in binary is fairly easily
> available without having to add said construct to the language.
> Do you agree with this? Or have I misunderstood what you're
> trying to say?
Pretty much, though I disagree that it's "fairly easy". I find
that it's difficult enough that it's rarely worth the effort.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-26 07:44 -0700
Re: Spurious diagnostic messages Keith Thompson <kst-u@mib.org> - 2015-09-26 15:33 -0700
Re: Spurious diagnostic messages Gareth Owen <gwowen@gmail.com> - 2015-09-28 19:57 +0100
Re: Spurious diagnostic messages Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-28 20:52 +0100
Re: Spurious diagnostic messages Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-09-29 11:19 +0000
Re: Spurious diagnostic messages glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-28 22:26 +0000
Re: Spurious diagnostic messages Bartc <bc@freeuk.com> - 2015-09-30 13:56 +0100
Re: Spurious diagnostic messages Gareth Owen <gwowen@gmail.com> - 2015-09-30 19:22 +0100
Re: Spurious diagnostic messages Bartc <bc@freeuk.com> - 2015-09-30 19:45 +0100
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-04 09:02 -0700
Re: Spurious diagnostic messages Bartc <bc@freeuk.com> - 2015-10-04 18:34 +0100
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-05 00:23 -0700
Re: Spurious diagnostic messages Keith Thompson <kst-u@mib.org> - 2015-10-04 15:56 -0700
Re: Spurious diagnostic messages supercat@casperkitty.com - 2015-10-04 20:04 -0700
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-09 09:13 -0700
Re: Spurious diagnostic messages Keith Thompson <kst-u@mib.org> - 2015-10-09 13:40 -0700
Re: Spurious diagnostic messages David Brown <david.brown@hesbynett.no> - 2015-10-10 22:26 +0200
Re: Spurious diagnostic messages supercat@casperkitty.com - 2015-10-10 13:49 -0700
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-14 07:53 -0700
Re: Spurious diagnostic messages Ian Collins <ian-news@hotmail.com> - 2015-09-27 17:30 +1300
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-04 10:26 -0700
Re: Spurious diagnostic messages Ian Collins <ian-news@hotmail.com> - 2015-10-05 17:02 +1300
Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-09 10:06 -0700
csiph-web