|
|
Up |
|
|
  |
Author: erik quanstromerik quanstrom Date: Apr 26, 2007 20:12
are these c99 "features" from /sys/src/cmd/cc/c99 really features
or are they "unwanted"?
Not done (yet?):
11. _Complex, _Imaginary, _Bool
18. Notation for universal characters \uXXXX
26. _Bool, float _Complex, double _Complex, long double _Complex
- erik
|
| |
|
| | 25 Comments |
|
  |
Author: David LeimbachDavid Leimbach Date: Apr 26, 2007 20:46
Those are all real C99 features :-).
Whether anyone really thinks they're worth a damn is another question.
On 4/26/07, erik quanstrom coraid.com> wrote:
> are these c99 "features" from /sys/src/cmd/cc/c99 really features
> or are they "unwanted"?
>
> Not done (yet?):
> 11. _Complex, _Imaginary, _Bool
> 18. Notation for universal characters \uXXXX
> 26. _Bool, float _Complex, double _Complex, long double _Complex
>
> - erik
>
--
- Passage Matthew 5:37:
But let your communication be, Yea, yea; Nay, nay: for whatsoever
is more than these cometh of evil.
|
| |
|
| | 1 Comment |
|
  |
Author: Joel C. SalomonJoel C. Salomon Date: Apr 26, 2007 21:55
On 4/26/07, erik quanstrom coraid.com> wrote:
> are these c99 "features" from /sys/src/cmd/cc/c99 really features
> or are they "unwanted"?
>
> 11. _Complex, _Imaginary, _Bool
That'd be a question for the HPC people; ron, do you miss complex types in 9c?
_Bool is a notational convenience, maybe helping document functions
returning only pass/fail status, or for the isalpha(2) family of
functions.
> 18. Notation for universal characters \uXXXX
For the characters in Plan 9's char set, it's unneeded; you can type
the character in as many keystrokes (Alt, X, xxxx). For characters
outside Unicode's BMP, it's not terribly helpful, since Plan 9 doesn't
understand them at all.
That said, these universal characters aren't hard to implement at all.
Come semester's end and I'll submit a patch to add them to the lexer.
|
| |
| 21 Comments |
|
  |
Author: Bruce EllisBruce Ellis Date: Apr 26, 2007 21:56
official C went downhill more than 20 years ago.
fortunately you can still program in what i called "Safe-C"
in some flippant paper.
i was particulalry impressed with VS2005 which has
wchar_t as a fundamental type which can't be assigned
to anything.
shoot me, i did a if(sizeof(wchar_t) == sizeof(Rune)) etc.
it seems that subjective C is more popular than objective C.
brucee
|
| Show full article (1.06Kb) |
| no comments |
|
  |
Author: Bruce EllisBruce Ellis Date: Apr 26, 2007 21:59
never understimate trigraphs for something that made it into a standard
but nobody every uses. ever.
brucee.
On 4/27/07, Joel C. Salomon gmail.com> wrote:
> On 4/26/07, erik quanstrom coraid.com> wrote:
>> are these c99 "features" from /sys/src/cmd/cc/c99 really features
>> or are they...
|
| Show full article (1.05Kb) |
| no comments |
|
  |
Author: Charles ForsythCharles Forsyth Date: Apr 27, 2007 03:59
>_Bool is a notational convenience, maybe helping document functions
>returning only pass/fail status, or for the isalpha(2) family of
>functions.
no, since its type is different from that produced by the logical
and equality operators (eg, ! and ==) which are still int!
it's a unsigned integer type with a limited range (0 or 1), a special
conversion rule, and of course a peculiar name (not even _bool!).
pointless tinkering.
|
| |
| 1 Comment |
|
  |
Author: Charles ForsythCharles Forsyth Date: Apr 27, 2007 04:11
>_Bool is a notational convenience, maybe helping document functions
>returning only pass/fail status, or for the isalpha(2) family of
>functions.
oh: and isalpha etc are defined to return int, as are all the other
(conventionally) boolean operations and functions of the standard,
although perhaps i overlooked some.
as a convenience it's mainly a suitable target for micturating.
|
| |
| no comments |
|
  |
Author: erik quanstromerik quanstrom Date: Apr 27, 2007 04:51
>
> That said, these universal characters aren't hard to implement at all.
> Come semester's end and I'll submit a patch to add them to the lexer.
>
i'm having trouble imagining under what circumstances this could be useful.
can you help me out?
i have yet to see \uxxxx in any code that wasn't part of the c99 spec.
- erik
|
| |
| 6 Comments |
|
  |
Author: David LeimbachDavid Leimbach Date: Apr 27, 2007 06:50
On 4/27/07, Charles Forsyth terzarima.net> wrote:
>>_Bool is a notational convenience, maybe helping document functions
>>returning only pass/fail status, or for the isalpha(2) family of
>>functions.
>
> no, since its type is different from that produced by the logical
> and equality operators (eg, ! and ==) which are still int!
> it's a unsigned integer type with a limited range (0 or 1), a special
> conversion rule, and of course a peculiar name (not even _bool!).
> pointless tinkering.
>
Since we're complaining about stuff being standardized to death...
consider the entire tgmath.h header which actually can't be
implemented in legal C99... yet is a part of C99. That one's a real
twister...
|
| |
| no comments |
|
  |
|
|
  |
Author: Joel C. SalomonJoel C. Salomon Date: Apr 27, 2007 07:22
On 4/27/07, erik quanstrom coraid.com> wrote:
>> That said, these universal characters aren't hard to implement at all.
>
> i'm having trouble imagining under what circumstances this could be useful.
> can you help me out?
They'd only be useful on systems that don't support Unicode in source
files, the way digraphs and trigraphs are only useful if you have a
broken keyboard without braces. But they're part of the spec, add
maybe 20 lines of code, and don't slow anything down unless they're
used. Maybe in the Unix port of kencc they'll be wanted.
Besides, the handful of minor patches I've submitted have all been
accepted; it's high time I try something that gets rejected. ☺
--Joel
|
| |
| 5 Comments |
|
|
|
|