Article View: comp.lang.postscript
Article #1339Re: Blue book #19 confustion
From: rsilverman
Date: Sat, 18 Nov 1989 00:10
Date: Sat, 18 Nov 1989 00:10
22 lines
1294 bytes
1294 bytes
In article <932@mtk.UUCP>, marmar@mtk.UUCP (Mark Martino) writes:
> I was studying example #19 in the blue book today and I came across a
> line that I don't understand. The program runs so it must make sense to
> the interpreter, but it doesn't make sense to me.
>
> When creating a new font dictionary, this example uses this line:
>
> { exch newfont 3 1 roll put }
>
> "newfont" appears to be a new empty dictionary. I don't understand how
> newfont is being accessed and used here. If one enters a string without
> the "/", the interpreter trys to find it in the dictionaries. Shouldn't this
> return some kind of "can't find" error? It seems to do this if you set
> this up and try to run it by itself.
If you look just four lines earlier in the code, you find
/newfont numentries dict def
which creates a new dictionary via the "dict" operator and binds it to the name
"newfont". Does this answer your question?
Richard Silverman
Technical Details
Message-ID:
<3799@eagle.wesleyan.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!yale!eagle!rsilvermanReferences:
<932@mtk.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!yale!eagle!rsilverman From: rsilverman@eagle.wesleyan.edu Newsgroups: comp.lang.postscript Subject: Re: Blue book #19 confustion Message-ID: <3799@eagle.wesleyan.edu> Date: 18 Nov 89 00:10:32 GMT References: <932@mtk.UUCP> Distribution: usa Lines: 22