

Article 1943 of comp.lang.postscript:
Path: mimsy!eneevax!haven!ames!mailrus!tut.cis.ohio-state.edu!ucbvax!phoenix.cambridge.ac.UK!CET1
>From: [email-masked] (Chris Thompson)
Newsgroups: comp.lang.postscript
Subject: Re: How long can a PostScript name be?
Message-ID: <[email-masked]>
Date: 28 Feb 89 16:04:07 GMT
Sender: [email-masked]
Lines: 20

Thanks to Glenn Reid for his reply to my query, because it has told me
something I didn't know about PostScript: you can apply the "length"
operator to a name and get the length of the string necessary to hold
the results of cvs'ing it.

One couldn't have guessed this from the red book, I think. The "length"
operator is documented as working on arrays, dictionaries, and strings.
It doesn't explicitly say that those are the only things it works on,
but one is probably led to assume that, as "typecheck" is one of the
errors documented as possibly occurring.

In actual fact, experimentation with a LaserWriter (PostScript version
38.0) suggests that "length" can be applied to absolutely anything,
although the results aren't always as interesting as they are for a
name. All types except arrays, dictionaries, names and strings seem
to give the result 1.

Chris Thompson
JANET: [email-masked]
ARPA:  [email-masked]