Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hbo.UUCP!deven From: deven@hbo.UUCP (Jimmy G. Devenport) Newsgroups: comp.windows.news Subject: bug or feature? Message-ID: <9005042318.AA10031@> Date: 5 May 90 01:20:16 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 91 ok, I ran across this one while I was defining a new item which has about 3 ParentClasses and got a little mixed up (?) and everything looks fine but it gets an error: /InputItem currentdict /errorproc (Label:) () /Right /notify ObjectCanvas InputWidth 0 /new OneLine send store now everything as far as I know was looking great, I had all the comments to show what was on the stack at all the /new's all the way back to the subclass of TextItem (defined in $OPENWINHOME/lib/NeWS/liteitem.ps), BUT this is what happened: InputItem was left undefined! This is easy to fix , but what WAS defined? while looking for the error, and using (NeWS/debug.ps) to catch the error about InputItem being undefined and then looking at the current dictionaries and seeing what was on the dictstack ( "0 dictstack" ), I found something like this: (on the stack) dict[ ... ... dictionary[43/5000]: dictionary[51/5000] ...] now what's wrong with this? ok go into either NeWS 1.1 or NeWS 2.0 (this was under 2.0) and define a window or something or even look at systemdict and you should find that the dict[num]: dict[num] are both the same, ie not dict[num]: dict[someothernum] now how did this happen? I tried messing around in psh trying to get it to happen and did something like this: hbo% psh executive Welcome to NeWS 1.1 /dict1 30 dict def /dict2 50 dict def userdict pstack dict[ /dict2: dictionary[20] /execfile: file(?,W,R) /bye: {'quit'} /OriginatingHost: (hbo) /dict1: dictionary[62] ] dict2 dict1 def pstack dict[ dictionary[20]: dictionary[62] /dict2: dictionary[20] /execfile: file(?,W,R) /bye: {'quit'} /OriginatingHost: (hbo) /dict1: dictionary[62] ] quit... now the previous psh was under NeWS 1.1 but in NeWS 2.0 it's the same (that's where I got the bug in the first place), and the question is why does it do and what's the purpose of defining a dictionary to be another dictionary? and where or how do you or can you get this "literal" (the one on the left) dictionary? also what is the purpose of having something like this? is this what PostScript does? Is there any real documentation or "look out for this" stuff anywhere? and what is the purpose of having in a dictionary a key that has the dictionary defined as being the dictionary? ie: dict[ ...normal dict stuff dictionary[length]: dictionary[length] ] why is NeWS defined this way and are there any special bugs we haven't heard about if these are undef'd (and how do you get rid of them, are they really needed?) ??? and could there be an error defined somewhere that handles this (in a future release of NeWS) ? or maybe I don't know what I'm talking about because it's really not documented....? pretty strange bug? Jimmy G. Devenport Applied Computing Systems 2075 Trinity Drive Suite Lower Level (the dungeon) Lost Almost, NM 87544 (505) 662-3309 hbo!deven@atlantis.ees.anl.gov jd