Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Helge Blischke Newsgroups: comp.lang.postscript Subject: Re: Unbalanced [ Followup-To: comp.lang.postscript Date: Wed, 11 Sep 2013 18:34:07 +0200 Lines: 38 Message-ID: References: <86272e7d-88ce-4adb-ba92-3424ec5e89ca@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: individual.net zoaHV4Xs1Uohj507HNfHnQgoVJB+rIFU+gPHtWRwPNG6E58dwd Cancel-Lock: sha1:gXyK3RVHWJVAPk+3gxaUW97giIY= User-Agent: KNode/0.99.01 Xref: csiph.com comp.lang.postscript:1618 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