[comp.lang.postscript] Semantics of bind

ghost@aladdin.com (L. Peter Deutsch) (01/02/91)

I'm puzzled about two things in the operation of the PostScript
'bind' operator.

1) The Red Book seems to imply that bind will affect the top level of
a procedure even if the procedure is read-only or execute-only, but
not interior read- or execute-only procedures.  Is this really the
case?

2) Does bind affect packed arrays?  If not, packed arrays are of
substantially less value for the thing I would have thought they
would be ideal for, namely, procedures.

I would welcome enlightenment on this obscure subject.

L. Peter Deutsch :: Aladdin Enterprises :: P.O. box 60264, Palo Alto, CA 94306
ghost@aladdin.com ; {uunet,sun,decwrl}!parcplace!aladdin!ghost ; (415)329-0264
	    "Implementation is the sincerest form of flattery."

taft@adobe.com (Ed Taft) (01/06/91)

In article <38.UUL1.3#5127@aladdin.com> ghost@aladdin.com (L. Peter Deutsch) writes:
>1) The Red Book seems to imply that bind will affect the top level of
>a procedure even if the procedure is read-only or execute-only, but
>not interior read- or execute-only procedures.  Is this really the
>case?

Regrettably, the red book description is misleading on this point. An array
that isn't writable will not be affected by bind, whether it is the top-level
array or a nested one.

>2) Does bind affect packed arrays?

Yes, bind affects packed arrays to arbitrary depth, in spite of the fact
that packed arrays are always read-only.

Note that for arrays, the interpreter marks nested arrays read-only as it
goes along. This is how it avoids infinite recursion if nested arrays form a
circular structure. This is not necessary for packed arrays, since it's
impossible to create a circular structure consisting entirely of packed
arrays.
Ed Taft      taft@adobe.com      ...decwrl!adobe!taft