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


Groups > comp.lang.misc > #2097

Re: 100 Things

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.misc
Subject Re: 100 Things
Date 2014-05-01 21:02 +1200
Message-ID <bsegt5Fd2otU7@mid.individual.net> (permalink)
References <3SQ7v.155346$AI5.24849@fx32.am4> <ljq5sv$coh$1@dont-email.me> <kY48v.181432$Ey6.180503@fx24.am4> <bsdn38Fd2otU3@mid.individual.net> <gTn8v.204520$q95.128530@fx22.am4>

Show all headers | View raw


BartC wrote:
>
>
> "Ian Collins" <ian-news@hotmail.com> wrote in message
> news:bsdn38Fd2otU3@mid.individual.net...
>> BartC wrote:
>>>
>>> As for C being minimalist, I don't know if a language needing these types
>>> and macros (remembering to substitute all the combinations of 8 16, 32
>>> and
>>> 64 every time you see N):
>>
>> <snip long list>
>>
>> Give a lowish level language such as C works "close to the metal" on a
>> wide variety of hardware, how would you avoid having a collection of fixed
>> width types?
>
> You don't avoid having the range of different types (you need many of those
> anyway have a flexible set of types for storing data). But there are elegant
> ways of doing it without  having sprawling lists of macros and typedefs.
>
> For example, if T is any primitive type, then T:n could define a version
> which is n bits wide.

So you substitute an underscore for a colon?

What about the least and fast types?  The former don't appear very 
often, but the latter are very useful.

>> I agree there's a better way of (but not within the limits of C) to
>> specify the limits, but they require some form of generics (such as C++
>> std::numeric_limits).
>
> If T is a numeric type, then T'min and T'max could give you the lower and
> upper limits (as could T'bounds, giving a range type). And you can write
> X'min etc when you have an expression.
>
> You don't need exotic things such as generics. (I know the point of C++ is
> apparently as a tool to build your own language, but when some feature is a
> morning's work on a compiler, then that's a far simpler route.)

Generics save you from having to extend the language.

-- 
Ian Collins

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


Thread

C: 100 Things "BartC" <bc@freeuk.com> - 2014-04-29 17:57 +0100
  Re: 100 Things "James Harris" <james.harris.1@gmail.com> - 2014-04-30 07:40 +0100
    Re: 100 Things "BartC" <bc@freeuk.com> - 2014-04-30 12:16 +0100
      Re: 100 Things "James Harris" <james.harris.1@gmail.com> - 2014-04-30 13:54 +0100
        Re: 100 Things "BartC" <bc@freeuk.com> - 2014-04-30 14:39 +0100
          Re: 100 Things "James Harris" <james.harris.1@gmail.com> - 2014-04-30 20:18 +0100
            Re: 100 Things "BartC" <bc@freeuk.com> - 2014-04-30 22:40 +0100
              Re: 100 Things Kaz Kylheku <kaz@kylheku.com> - 2014-04-30 22:09 +0000
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-04-30 23:36 +0100
                Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-01 11:03 +1200
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 09:47 +0100
              Re: 100 Things "James Harris" <james.harris.1@gmail.com> - 2014-05-01 00:35 +0100
                Re: 100 Things Andy Walker <news@cuboid.co.uk> - 2014-05-01 11:03 +0100
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 20:16 +0100
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 12:44 +0100
                Re: 100 Things "James Harris" <james.harris.1@gmail.com> - 2014-05-02 11:11 +0100
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-02 13:32 +0100
                Re: 100 Things "James Harris" <james.harris.1@gmail.com> - 2014-05-02 16:42 +0100
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-02 17:54 +0100
          Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-01 11:01 +1200
      Re: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-30 21:13 -0400
        Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 09:26 +0100
          Re: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-01 16:08 -0400
      Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-01 13:42 +1200
        Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 09:35 +0100
          Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-01 21:02 +1200
            Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 10:40 +0100
              Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-01 22:06 +1200
          Re: 100 Things "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-01 11:08 +0200
            Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 11:02 +0100
              Re: 100 Things "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-01 13:57 +0200
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 15:12 +0100
                Re: 100 Things "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-01 17:18 +0200
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 17:04 +0100
                Re: 100 Things Kaz Kylheku <kaz@kylheku.com> - 2014-05-01 18:30 +0000
                Re: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-01 16:08 -0400
                Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-02 08:30 +1200
                Re: 100 Things George Neuner <gneuner2@comcast.net> - 2014-05-03 01:29 -0400
                Re: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-03 02:37 -0400
                Re: 100 Things George Neuner <gneuner2@comcast.net> - 2014-05-03 15:39 -0400
                Re: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-03 17:30 -0400
                Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-04 20:05 +1200
                Re: 100 Things George Neuner <gneuner2@comcast.net> - 2014-05-04 13:28 -0400
                Re: 100 Things Ian Collins <ian-news@hotmail.com> - 2014-05-05 07:40 +1200
                Re: 100 Things "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-01 22:00 +0200
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-01 23:24 +0100
                Re: 100 Things "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-02 08:59 +0200
                Re: 100 Things "BartC" <bc@freeuk.com> - 2014-05-02 09:53 +0100
                Re: 100 Things "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2014-05-02 11:22 +0200
                Re: 100 Things Kaz Kylheku <kaz@kylheku.com> - 2014-05-01 18:26 +0000
                Re: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-01 16:08 -0400
                Re: 100 Things Kaz Kylheku <kaz@kylheku.com> - 2014-05-02 02:49 +0000
  Re: C: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-04-30 22:08 -0400
  Re: C: 100 Things "BartC" <bc@freeuk.com> - 2014-07-25 23:53 +0100
    Re: C: 100 Things "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-07-26 05:38 -0400
      Re: C: 100 Things "BartC" <bc@freeuk.com> - 2014-07-26 13:51 +0100
        Re: C: 100 Things rick.c.hodgin@gmail.com - 2014-10-25 04:48 -0700
  Re: C: 100 Things "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2014-10-25 04:50 -0700

csiph-web