Re: Why is the dictionary checked before looking for a number?
- From: Albert van der Horst <albert@xxxxxxxxxxxxxxxxxx>
- Date: 29 Apr 2007 08:22:15 GMT
In article <0001HW.C2581D7E000D1E81F02845B0@xxxxxxxxxxxxxxxxxxxxxx>,
Charlie Springer <RAM@xxxxxxxxxxxx> wrote:
On Fri, 27 Apr 2007 05:26:47 -0700, Andrew Haley wrote
(in article <1333r07h4egsq1d@xxxxxxxxxxxxxxxxxx>):
I see what you mean about Hex. Is there any reason not to use a C
style prefix to signify hex (eg $DEADBEEF)? That would remove the
need for having to change bases.
It would, but it's very clumsy and you need a lot of prefixes for
decimal, hex, octal, binary, and so on. There's also the question of
output. It makes the whole system a lot more complicated.
I would like to have HEX and DECIMAL in c and get rid of all those blasted
0x.... when I have to make tables of constants or addresses. Setting the
radix seems like one of the few places where modal operations are useful and
can reduce errors.
C has c-ish ways to get rid of those, if you really want to.
As an exercise define the macro HEX, such that you can
do
HEX(ab,cd,ef,01,23,34,45,56)
instead of
0xab, 0xcd, ...
(Hint use the stringize operator ## )
-- Charlie Springer
Groetjes Albert
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
.
- Follow-Ups:
- Re: Why is the dictionary checked before looking for a number?
- From: Charlie Springer
- Re: Why is the dictionary checked before looking for a number?
- References:
- Why is the dictionary checked before looking for a number?
- From: Ged Byrne
- Re: Why is the dictionary checked before looking for a number?
- From: Ged Byrne
- Re: Why is the dictionary checked before looking for a number?
- From: Andrew Haley
- Re: Why is the dictionary checked before looking for a number?
- From: Charlie Springer
- Why is the dictionary checked before looking for a number?
- Prev by Date: Re: Forth Frustrations
- Next by Date: Re: Eliminating All Ambiguous Conditions
- Previous by thread: Re: Why is the dictionary checked before looking for a number?
- Next by thread: Re: Why is the dictionary checked before looking for a number?
- Index(es):