Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1618

Re: Unbalanced [

From Helge Blischke <h.blischke@acm.org>
Newsgroups comp.lang.postscript
Subject Re: Unbalanced [
Followup-To comp.lang.postscript
Date 2013-09-11 18:34 +0200
Message-ID <b9bkc0F7evuU1@mid.individual.net> (permalink)
References <86272e7d-88ce-4adb-ba92-3424ec5e89ca@googlegroups.com>

Followups directed to: comp.lang.postscript

Show all headers | View raw


anavi8r@gmail.com wrote:

> Hi everyone,
> 
> I am writing a PostScript interpreter for a product I sell, and while
> working with some sample .EPS files, I ran into the following:
> 
> /xpdfm
> {
> {
> dup 0 get/Label eq
> {
> aload length[exch 1 add 1 roll/PAGELABEL
> }{
> aload pop
> [{ThisPage}<<5 -2 roll>>/PUT
> }ifelse
> pdfmark_5
> }forall
> 
> 
> This code snippet contains two unbalanced opening square brackets ([).
> 
> Is this normal? How should this be treated by a PostScript interpreter?
> 
> Thanks in advance.
> 
> -- Peter

The "[" is a synonym for the "mark" operator. Its purpose is
to process the following objects on the operand stack back
up to the mark (and removing the mark object) without the necessity
to know how many objects to process.
See e.g. the cleartomark operator from the PLRM as a simple
example, or the array operator.

Helge

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Unbalanced [ anavi8r@gmail.com - 2013-09-11 09:16 -0700
  Re: Unbalanced [ Mark Carroll <mtbc@bcs.org> - 2013-09-11 17:28 +0100
  Re: Unbalanced [ Helge Blischke <h.blischke@acm.org> - 2013-09-11 18:34 +0200
  Re: Unbalanced [ luser- -droog <mijoryx@yahoo.com> - 2013-09-11 12:16 -0700
    Re: Unbalanced [ Helge Blischke <h.blischke@acm.org> - 2013-09-12 11:31 +0200
      Re: Unbalanced [ anavi8r@gmail.com - 2013-09-18 10:11 -0700

csiph-web