Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Kaz Kylheku <kaz@kylheku.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Updating C default type |
| Date | 2014-04-22 19:54 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <20140422123724.968@kylheku.com> (permalink) |
| References | <lj66ho$8fg$1@speranza.aioe.org> <lj6bsg$nji$1@speranza.aioe.org> <ratio-20140422202507@ram.dialup.fu-berlin.de> <lj6ep9$vkq$1@speranza.aioe.org> <5356C470.4010104@verizon.net> |
On 2014-04-22, James Kuyper <jameskuyper@verizon.net> wrote:
> On 04/22/2014 03:09 PM, glen herrmannsfeldt wrote:
>> Stefan Ram <ram@zedat.fu-berlin.de> wrote:
>> (snip, I wrote)
>>>> The only language in relatively common use that I know of with
>>>> a rational type is TIFF.
>>
>>> The following is a program for a language called »C++«:
>>
>>> #include <iostream>
>>> #include <ostream>
>>> #include <ratio>
>>
>> (snip)
>>
>>> { using r12 = ::std::ratio< 1, 2 >;
>>> using r24 = ::std::ratio< 2, 4 >;
>>
>> Hmm, OK, I meant as a fundamental data type, such that you didn't
>> have to #include anything, and didn't have to declare its variables
>> in a different way than more usual data types. (What Java calls
>> primitive data types.)
>>
>> If I could say:
>>
>> rational r12 = 1/2;
>> rational r14 = 1/4;
>> rational r34 = r12+r14;
>>
>> Then I would agree.
Note to glen: if you could say rational r12 = 1/2, then you would need the type
system of C expressions to support an inherited attribute scheme. I.e. the
fact that the result is expected to be of rational type flows across the
tree down into the / node, and causes a semantics change there to do a
rational division.
As it stands, C has synthesized attributes (for the most part): the type of
an expression is known from the types of its constituents alone, and
not from other context. (A few rules use inheritance. E.g. expressions are
lvalues based on their contextual location, and that ripples down
into their constituents. X is an lvalue in some contexts, and
if X is an lvalue and a struct/union, then X.memb is, and so on.)
> Like C, C++ packages in it's standard library many features that in
> other languages are part of the language itself (e.g. <stdint.h>). Since
> a conforming implementation of C (or C++) must provide support not only
> for the language, but also for the standard library, I don't think it
> makes much sense to make such distinctions.
Yes it does. C and C++ are not designed in such a way that there is no way
to tell whether something is a language or library feature.
There are features that, if removed from C, cannot be put back by writing C code.
Generally speaking, those are "language proper" and all else is "library".
The features that cannot be written in C enjoy special privilege; they are better
integrated which usually makes them less cumbersome to use.
Support is not only a yes or no question but a how well question, but also of
how well: what level or depth of support.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Updating C default type Raj Pashwar <raj121190@hotmail.NOSPAM.com> - 2014-04-22 16:48 +0000
Re: Updating C default type jacob navia <jacob@spamsink.net> - 2014-04-22 18:59 +0200
Re: Updating C default type Raj Pashwar <raj121190@hotmail.NOSPAM.com> - 2014-04-22 17:13 +0000
Re: Updating C default type Keith Thompson <kst-u@mib.org> - 2014-04-22 11:59 -0700
Re: Updating C default type Kaz Kylheku <kaz@kylheku.com> - 2014-04-22 19:12 +0000
Re: Updating C default type jacob navia <jacob@spamsink.net> - 2014-04-25 19:31 +0200
Re: Updating C default type Stephen Sprunk <stephen@sprunk.org> - 2014-04-22 15:41 -0500
Re: Updating C default type "BartC" <bc@freeuk.com> - 2014-04-22 21:47 +0100
Re: Updating C default type Ken Brody <kenbrody@spamcop.net> - 2014-04-24 12:25 -0400
Re: Updating C default type Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-24 10:32 -0700
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-24 20:17 +0000
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-24 21:03 +0000
Re: Updating C default type Gareth Owen <gwowen@gmail.com> - 2014-04-22 19:12 +0100
Re: Updating C default type Keith Thompson <kst-u@mib.org> - 2014-04-22 10:26 -0700
Re: Updating C default type Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-22 10:28 -0700
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-22 18:20 +0000
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-22 19:09 +0000
Re: Updating C default type James Kuyper <jameskuyper@verizon.net> - 2014-04-22 15:35 -0400
Re: Updating C default type James Kuyper <jameskuyper@verizon.net> - 2014-04-22 15:38 -0400
Re: Updating C default type Kaz Kylheku <kaz@kylheku.com> - 2014-04-22 19:54 +0000
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-22 21:27 +0000
Re: Updating C default type "BartC" <bc@freeuk.com> - 2014-04-22 23:08 +0100
Re: Updating C default type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-04-22 22:03 +0100
Re: Updating C default type Thomas Jahns <jahns@idontlikespam.dkrz.de> - 2014-04-23 09:59 +0200
Re: Updating C default type David Thompson <dave.thompson2@verizon.net> - 2014-05-25 16:44 -0400
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-05-26 05:48 +0000
Re: Updating C default type "Osmium" <r124c4u102@comcast.net> - 2014-04-22 14:01 -0500
Re: Updating C default type Quentin Pope <qp19433@hotmail.NOSPAM.com> - 2014-04-23 16:57 +0000
Re: Updating C default type James Kuyper <jameskuyper@verizon.net> - 2014-04-23 13:13 -0400
Re: Updating C default type Kaz Kylheku <kaz@kylheku.com> - 2014-04-23 18:02 +0000
Re: Updating C default type Keith Thompson <kst-u@mib.org> - 2014-04-23 11:33 -0700
Re: Updating C default type Kaz Kylheku <kaz@kylheku.com> - 2014-04-22 19:08 +0000
Re: Updating C default type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-04-22 22:08 +0100
Re: Updating C default type "BartC" <bc@freeuk.com> - 2014-04-22 22:19 +0100
Re: Updating C default type Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-22 14:13 -0700
Re: Updating C default type Stephen Sprunk <stephen@sprunk.org> - 2014-04-23 11:55 -0500
Re: Updating C default type Keith Thompson <kst-u@mib.org> - 2014-04-23 10:55 -0700
Re: Updating C default type Robert Wessel <robertwessel2@yahoo.com> - 2014-04-24 00:03 -0500
Re: Updating C default type Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-04-23 22:37 -0700
Re: Updating C default type glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-24 12:05 +0000
Re: Updating C default type gordonb.ez7sl@burditt.org (Gordon Burditt) - 2014-04-25 06:11 -0500
Re: Updating C default type James Kuyper <jameskuyper@verizon.net> - 2014-04-25 08:48 -0400
Re: Updating C default type Stephen Sprunk <stephen@sprunk.org> - 2014-04-22 15:30 -0500
Re: Updating C default type ralph <nt_consulting@yahoo.com> - 2014-04-22 23:18 -0500
Re: Updating C default type Ken Brody <kenbrody@spamcop.net> - 2014-04-24 12:28 -0400
Re: Updating C default type gordonb.oztxz@burditt.org (Gordon Burditt) - 2014-04-24 23:50 -0500
Re: Updating C default type James Kuyper <jameskuyper@verizon.net> - 2014-04-25 08:41 -0400
Re: Updating C default type Hans Vlems <hvlems@freenet.de> - 2014-05-25 23:57 -0700
Re: Updating C default type Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-05-26 01:55 -0700
Re: Updating C default type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-05-26 13:01 +0100
Re: Updating C default type Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-05-26 13:12 -0700
Re: Updating C default type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-05-26 22:31 +0100
Re: Updating C default type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-05-26 23:55 +0100
Re: Updating C default type Keith Thompson <kst-u@mib.org> - 2014-05-26 17:11 -0700
Re: Updating C default type James Kuyper <jameskuyper@verizon.net> - 2014-05-27 07:54 -0400
csiph-web