Xref: utzoo comp.sys.amiga.tech:308 comp.sys.amiga:17661 comp.lang.c:9338 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!rutgers!bellcore!tness7!tness1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga,comp.lang.c Subject: Re: 'C' style etc... Message-ID: <1829@sugar.UUCP> Date: 14 Apr 88 11:33:47 GMT References: <8647@eddie.MIT.EDU> <893@nuchat.UUCP> <8449@agate.BERKELEY.EDU> <2563@geac.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 40 Keywords: K&R, nonstandard constructs, multi-char char constants, hashing In article <2563@geac.UUCP>, daveb@geac.UUCP writes: > I said... > > > case 'REXX': > > ... makes perfect sense, modulo byte ordering problems, > > so by the principle of least astonishment it should be there. > Well, it works IFF you have 4-byte words, or a good promotion > mechanism to make 'REXX' turn into a long automagically (some do). Well, that's what I'm suggesting be added to ANSI. After all, they're adding lots of stuff that's even less likely to be useful. Basically, make 'chars' map unto an unsigned integer of length necessary to fit that many characters into. The maximum would depend on how many characters you can fit into the longest long. On machines like the Cray that'd be 8 characters. > It truncates on many 16-bit machines... including one old > pdp-11 I remember fondly. I never tried case 'ABCD' on a pdp-11, but I found case 'AB' quite useful. > If you want something humorous, try using case `REXX` (notice the > quotes) on a machine using an old copy of PCC: It tries to generate > BCD for a GCOS 3 machine. That's a neat idea. That's something else that would be useful when dealing with machines like Spermys and Control Data boxes that have weird charset sizes: `xxx` means xxx in the native character set, for cases where ANSI is supported but not the lowest common denominator. On the PDP-11 that would be RAD-50 :->. Sort of like the Fortran 4 plus notation "6RMCP..." :->. > --dave (prior art, yes. yucko, though) c-b For 'C'-as-structured-assembly-weenies it's totally k00l :->. -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- "Have you hugged your U wolf today?" ...!bellcore!tness1!sugar!peter -- Disclaimer: These aren't mere opinions, these are *values*.