From: Carl Taylor
Subject: Vertical bars & alphanumeric strings
Date: 
Message-ID: <kr_gc.4860$um3.131446@bgtnsc04-news.ops.worldnet.att.net>
Lisp learner/hobbyist here.  Why does Lisp enclose with vertical bars
alphanumeric symbols consisting of numbers concatenated to a *single*
letter.  I've read Graham p. 134, and gather such symbols, if left unbarred,
would have some special significance for the reader.

Thanks for any info.

Carl Taylor

CL-USER 2 > (setf test-list '(2r 4z 56y 8uuh 9k 1c 22x 70l 3m 4ygf 88 8uu
234 666v 66 3d xxx wow 7b 345tt 1s 8u 4yg))
(|2R| |4Z| |56Y| 8UUH |9K| |1C| |22X| |70L| |3M| 4YGF 88 8UU 234 |666V| 66
|3D| XXX WOW |7B| 345TT |1S| |8U| 4YG)

CL-USER 4 > (list '8 '8x '8xx '8abc '88 '88e '888h '88xx '888xxx '88888t)
(8 |8X| 8XX 8ABC 88 |88E| |888H| 88XX 888XXX |88888T|)

From: Edi Weitz
Subject: Re: Vertical bars & alphanumeric strings
Date: 
Message-ID: <m365bveafm.fsf@bird.agharta.de>
On Tue, 20 Apr 2004 00:48:16 GMT, "Carl Taylor" <··········@att.net> wrote:

> Lisp learner/hobbyist here.  Why does Lisp enclose with vertical
> bars alphanumeric symbols consisting of numbers concatenated to a
> *single* letter.  I've read Graham p. 134, and gather such symbols,
> if left unbarred, would have some special significance for the
> reader.
>
> Thanks for any info.
>
> Carl Taylor
>
> CL-USER 2 > (setf test-list '(2r 4z 56y 8uuh 9k 1c 22x 70l 3m 4ygf 88 8uu
> 234 666v 66 3d xxx wow 7b 345tt 1s 8u 4yg))
> (|2R| |4Z| |56Y| 8UUH |9K| |1C| |22X| |70L| |3M| 4YGF 88 8UU 234 |666V| 66
> |3D| XXX WOW |7B| 345TT |1S| |8U| 4YG)
>
> CL-USER 4 > (list '8 '8x '8xx '8abc '88 '88e '888h '88xx '888xxx '88888t)
> (8 |8X| 8XX 8ABC 88 |88E| |888H| 88XX 888XXX |88888T|)

Those are "potential numbers" - see

  <http://www.lispworks.com/reference/HyperSpec/Body/02_caa.htm>.

Edi.
From: Thomas A. Russ
Subject: Re: Vertical bars & alphanumeric strings
Date: 
Message-ID: <ymi3c6vsns1.fsf@sevak.isi.edu>
"Carl Taylor" <··········@att.net> writes:

> 
> Lisp learner/hobbyist here.  Why does Lisp enclose with vertical bars
> alphanumeric symbols consisting of numbers concatenated to a *single*
> letter.  I've read Graham p. 134, and gather such symbols, if left unbarred,
> would have some special significance for the reader.
> 
> Thanks for any info.

I think you need to ask your Lisp vendor.  Or at least tell us which
Lisp implementation you are using.  Under ACL 5.0.1 on a Sparc, none of
your test cases below print with vertical bars.

> CL-USER 2 > (setf test-list '(2r 4z 56y 8uuh 9k 1c 22x 70l 3m 4ygf 88 8uu
> 234 666v 66 3d xxx wow 7b 345tt 1s 8u 4yg))
> (|2R| |4Z| |56Y| 8UUH |9K| |1C| |22X| |70L| |3M| 4YGF 88 8UU 234 |666V| 66
> |3D| XXX WOW |7B| 345TT |1S| |8U| 4YG)
> 
> CL-USER 4 > (list '8 '8x '8xx '8abc '88 '88e '888h '88xx '888xxx '88888t)
> (8 |8X| 8XX 8ABC 88 |88E| |888H| 88XX 888XXX |88888T|)

I suppose that if I had to speculate, it is either an off-by-one error
or possibly some very conservative behavior on the part of the printer
which wants to make sure that it prints symbols with names starting with
digits as symbols.

Most Lisp systems don't do this, although the resulting values are
clearly legal, given that they will be properly read by the Lisp
reader.


-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Carl Taylor
Subject: Re: Vertical bars & alphanumeric strings
Date: 
Message-ID: <5J_hc.12109$_o3.393094@bgtnsc05-news.ops.worldnet.att.net>
"Thomas A. Russ" <···@sevak.isi.edu> wrote in message
····················@sevak.isi.edu...
> "Carl Taylor" <··········@att.net> writes:
>
> >
> > Lisp learner/hobbyist here.  Why does Lisp enclose with vertical bars
> > alphanumeric symbols consisting of numbers concatenated to a *single*
> > letter.
[...]

> I think you need to ask your Lisp vendor.  Or at least tell us which
> Lisp implementation you are using.  Under ACL 5.0.1 on a Sparc, none of
> your test cases below print with vertical bars.

These examples were run on Xanalys LispWorks 4.3 which claims to be ANSI
standard.

[...]

> > CL-USER 4 > (list '8 '8x '8xx '8abc '88 '88e '888h '88xx '888xxx
'88888t)
> > (8 |8X| 8XX 8ABC 88 |88E| |888H| 88XX 888XXX |88888T|)

> I suppose that if I had to speculate, it is either an off-by-one error
> or possibly some very conservative behavior on the part of the printer
> which wants to make sure that it prints symbols with names starting with
> digits as symbols.
>
> Most Lisp systems don't do this, although the resulting values are
> clearly legal, given that they will be properly read by the Lisp
> reader.

Edi Weitz's reply about "potential numbers" seems to explain it.  The cited
CLHS link starts off with:
 "To allow implementors and future Common Lisp standards to extend the
syntax of numbers, a syntax for 'potential numbers' is defined that is more
general than the syntax for numbers"....

  <http://www.lispworks.com/reference/HyperSpec/Body/02_caa.htm>.

Carl Taylor