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


Groups > comp.lang.postscript > #3262

Re: {} {} while

Newsgroups comp.lang.postscript
Date 2018-05-19 14:22 -0700
References <7d0a87b1-8bc9-424a-9183-3971c718dc6f@googlegroups.com>
Message-ID <676b9963-92ab-41a3-a5dd-4e42c365dbe0@googlegroups.com> (permalink)
Subject Re: {} {} while
From luser droog <luser.droog@gmail.com>

Show all headers | View raw


On Friday, May 18, 2018 at 8:59:24 PM UTC-5, luser droog wrote:
> An interesting post in comp.lang.forth had an example
> of a "while loop". The style of the example was inspired
> by PostScript, but PostScript has no such 'while' loop...
> 
> 
> ...until now.
> 
> % {condition} {body} while
> % 
> /while {
>     exch {{exit} if} compose
>     exch compose
>     loop
> } def
> 
> /compose {
>     2 array astore cvx {aload pop} map
> } def
> 
> /map {
>     1 index xcheck 3 1 roll
>     [ 3 1 roll forall ]
>     exch {cvx} if
> } def

Hah. Forgot a 'not' in there. I guess this is
actually an "until" loop with the wrong name. Oops.

Back to comp.lang.postscript | Previous | NextPrevious in thread | Find similar


Thread

{} {} while luser droog <luser.droog@gmail.com> - 2018-05-18 18:59 -0700
  Re: {} {} while luser droog <luser.droog@gmail.com> - 2018-05-19 14:22 -0700

csiph-web