> From: Peter Gerwinski <peter(a)agnes.dida.physik.uni-essen.de>
> Subject: Re: Hex output.
> To: richard.kerry(a)quantel.com, gpc(a)hut.fi
> Date: Wed, 5 Nov 1997 14:46:11 +0100 (MET)
> According to richard.kerry(a)quantel.com:
> >
> > Does gpc have a built-in mechanism for converting a number to hexadecimal,
> > for use in write(ln) or just as a number to string conversion ?
>
> No(t yet;-).
>
> > Oregon Pascal uses a negative field width to denote hex output (which I
> > believe is sometimes also used to denote left justification), and Vax
> > Pascal has a built-in 'hex( num, width )'.
>
> I do not think it's good to use negative field widths for this purpose
> (except, perhaps, for compatibility reasons). The Vax syntax, OTOH,
> seems quite nice for me.
>
> Right now we are still trying to finish up gpc-2.1, but we might take
> this into account for gpc-2.2.
>
> Hmm ... what about something like `NumBase ( base, num, width )' to
> allow for arbitrary bases like in `2#101010'?
May be that sort of thing should be left to libraries, rather than
build into the run time system. The main advantage of the Wirth family of
languages, compared to comitte languages like, say, Ada, has always been
that their syntax was limited to the necessary. It is easy enough to
write a little library to read and write hex numbers and to convert
them to and from integers and strings. Copying any odd feature from any odd
Pascal compiler out there will create something big and cumbersome,
that nobody in the end will be able to handle anymore.