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


Groups > comp.lang.postscript > #3502

Re: browse-dict -- Thinking in Postscript Example 10.9 on page 128

Newsgroups comp.lang.postscript
Date 2020-03-23 07:26 -0700
References <4a78ff2b-36d9-4608-9228-6d217805d17d@googlegroups.com>
Message-ID <a99b7c8b-66e1-4cd3-8cbe-2029edc6ea62@googlegroups.com> (permalink)
Subject Re: browse-dict -- Thinking in Postscript Example 10.9 on page 128
From luser droog <luser.droog@gmail.com>

Show all headers | View raw


On Monday, March 23, 2020 at 9:03:27 AM UTC-5, douglas....@gmail.com wrote:
> Folks,
> 
> Below does not work as shown in subject text.
> Can someone fix or offer a better solution?
> 
> Thx, Doug
> ======snip=============
> /browse-dict % dictionary browse-dict -
> { %def
> { %forall
> exch (key: ) print ==
> dup type
> dup /dicttype eq { %ifelse

Remove the dup here. It's leaving an extra unneeded copy of the type.

> (subdictionary: ) print
> browse-dict % recursively browse dictionary
> }{
> (value: ) print ==
> } ifelse
> } forall
> } bind def
> 
> /testDict1	<<
> 	/a 1
> 	/b [ 1 2 3 ]
> 	/c	<<
> 		/key1 4
> 		/key2 5
> 		/key3 6
> 	>>
> >> def
> 
> testDict1
> browse-dict

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


Thread

browse-dict -- Thinking in Postscript Example 10.9 on page 128 douglas.mcallaster@gmail.com - 2020-03-23 07:03 -0700
  Re: browse-dict -- Thinking in Postscript Example 10.9 on page 128 luser droog <luser.droog@gmail.com> - 2020-03-23 07:26 -0700

csiph-web