Re: *print-base*

Gary Byers <[email protected]> Fri, 1 Aug 2003 13:39:13 -0600 (MDT)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
Especially when *print-base* is something other than 10., it's sometimes
helpful to set *print-radix* as well:

? (setq *print-radix* t)
T
? 10
10.
? (setq *print-base* 16)
#x10
? 10
#xA
?

On Fri, 1 Aug 2003, Edi Weitz wrote:

> On Thu, 31 Jul 2003 19:10:26 -0400, Paul <[email protected]> wrote:
>
> > The below transcript should be fairly self-explanatory.
> >
> > Welcome to OpenMCL Version (Alpha: Darwin) 0.14-030623!
> > ? (setf *print-base* 16)
> > 10
> > ? *print-base*
> > 10
> >
> > This seems rather broken to me.
>
> But it's correct. You wanted numbers to be printed as hexadecimals and
> 16 (decimal) is '10' when printed as an hexadecimal.
>
> Here's what CMUCL does. I'm sure every self-respecting CL
> implementation will do the same:
>
>   * (setf *print-base* 16)
>
>   10
>   * *print-base*
>
>   10
>   * 10
>
>   A
>   * (format nil "~X" 16)
>
>   "10"
>   * (setf *read-base* 16)
>
>   10
>   * (format nil "~X" 10)
>
>   "10"
>   * 10
>
>   10
>
> Edi.
>
> _______________________________________________
> bug-openmcl mailing list
> [email protected]
> http://clozure.com/cgi-bin/mailman/listinfo/bug-openmcl
>
>