🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3697

Re: Why "long long" doesn't work.

#3697
From: Peter Holzer
Date: Thu, 10 Aug 1995 16:17
50 lines
2735 bytes
ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes:

>Seriously, I would _much_ rather the C9X committee spent a lot of effort
>trying to solve the "environment enquiry" and "type selection" problems
>than copying things from C++.  

Absolutely. Actually a cleanup of the library is first on my wish list,
but those things are a close second.

>Type selection problem:
[...]
>	signed<LowExpr, HighExpr>.
[...]
>	Imagine unsigned<MaxExpr>.
[...]
>	float<X,Y> meaning a floating point type that can represent both
>	X and Y as distinct values would do the job.

>    How can I solve these problems without a tangle of bizarre syntax?
>    The samples above use C++-like notation FAMILY<e1,...,en> meaning the
>    "cheapest" member of the family that can represent all the listed
>    numbers distinctly.  We still need a way to say optimise for time/
>    optimise for space/use exactly N bits, but _please_ let's not have as
>    much syntax as recent proposals here have suggested.

I like your syntax. It is going to make people think about the ranges
they need instead of just writing blindly int:32 for every integral
value they need (I read somewhere that many PL/I programmers always
specified 36 bits of precision, which hurt their code badly when it
was ported to 32 bit architectures). I don't see how you can get
away with less syntax than the other proposals if wou want to specify
the same things. You want precision: You need either a set of values
that must be representable or the precision in bits. You want to 
specify whether the size should be exact or not and how you want
it optimized. That's at least two additional keywords. With this you
are about as complicated as the EIP proposal. A syntactically simple
solution would be something like 

int{32,3} signed_32_bit_int_exact_and_fast;

where the first value in braces gives the procision and the second
determines the properties by oring some flags together, but I don't
think thats very elegant either.

	hp
--
   _  | Peter Holzer | Systemadministrator WSR | hjp@wsr.ac.at
|_|_) |-------------------------------------------------------
| |   |  ...and it's finished!  It only has to be written.
__/   |         -- Karl Lehenbauer
Technical Details
Message-ID: <40dbe8$bmm@wsrcom.wsr.ac.at>
Path: arc1-ca.pugleaf.net!wsrcom.wsr.ac.at!wsrdb!hjp
References: <3uvcje$c3q@goanna.cs.rmit.edu.au> <3v34qv$hev@newsbf02.news.aol.com> <3va1o3$aas@goanna.cs.rmit.edu.au> <3vq4p5$8dv@wsrcom.wsr.ac.at> <409fr9$guo@goanna.cs.rmit.edu.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wsrcom.wsr.ac.at!wsrdb!hjp
From: hjp@wsrdb.wsr.ac.at (Peter Holzer)
Newsgroups: comp.std.c
Subject: Re: Why "long long" doesn't work.
Date: 10 Aug 1995 16:17:12 GMT
Organization: WSR, Vienna, Austria
Message-ID: <40dbe8$bmm@wsrcom.wsr.ac.at>
References: <3uvcje$c3q@goanna.cs.rmit.edu.au> <3v34qv$hev@newsbf02.news.aol.com> <3va1o3$aas@goanna.cs.rmit.edu.au> <3vq4p5$8dv@wsrcom.wsr.ac.at> <409fr9$guo@goanna.cs.rmit.edu.au>
NNTP-Posting-Host: wsrdb.wsr.ac.at