ibase and obase



Am 18 Jun 2006 um 22:20 hat Robert Dodier geschrieben:
 
> For the record here is a reimplementation of ascii-numberp
> and some examples. Note the use of the trailing decimal point
> to indicate an integer in base 10; this is a useful Lisp-ism inherited
> by Maxima.
> 
> (defun ascii-numberp (putative-digit)
>   (and
>    (characterp putative-digit)
>    (find
>     (char-downcase putative-digit)
>     (subseq "0123456789abcdefghijklmnopqrstuvwxyz" 0 *read-base*))))
> 

Hi Robert,

I have loaded this code and tried it out.

(%i2) block( [ibase:16], a );
(%o2) 				       a
(%i3) block( ibase:16, a );
(%o3) 				       a
(%i4) a;
(%o4) 				      10

An assignment to ibase in a block doesn't have any consequence inside the block itself.
Does it make sense then, if this only works in top level?

Maybe one could think about implementing bytestrings.

Volker