Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ENG.SUN.COM!wmb From: wmb@ENG.SUN.COM Newsgroups: comp.lang.forth Subject: Re: Why is Postscript not Forth? Message-ID: <9002210136.AA20515@jade.berkeley.edu> Date: 20 Feb 90 20:33:10 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: wmb@ENG.SUN.COM Organization: The Internet Lines: 53 > > [Doing PostScript's closure is not easy nor portable in Forth, but > > doing Forth's closure's in PostScript is easy.] > Ok, I concede the point here. I might ask if this doesn't raise the > question of the proper factoring of the Forth closure-making words? It certainly does. The problem with trying to factor them is that there are so many different things going on with the different kinds of closures. The "branch class" of closure (BEGIN and IF structures) can be easily factored, but the DO class has some other wierd things going on, the ":" class throws in some more wrinkles, and then DOES> wierds it out even more. Serious "ad-hoc" action here. > > In PostScript, stack objects are typed, and if you try to use e.g. a > > logical operator on a number object, you get an error signal and the > > operation aborts. > Yes, but can you trivially write a word that converts between types, or > is type-ness inaccesable? PostScript already provides words to convert between types, but some pairs of types are not mutually convertible. The original point was that Forth is inherently untyped and PostScript is inherently strongly typed, and that this difference is fundamental. The above argument supports that claim. In Forth, you can ultimately do anything you want with a stack cell, and in PostScript, you can only do "type consistent" things. > > ... difficulty of creating explicitly-named words within definitions ... > Again, doesn't this point to a factoring problem with the dictionary > manipulating words? Having good streams doesn't solve the problem that > there should be a word that creates a dictionary entry from a 'string' > on the stack. Absolutely right. The dictionary manipulation words in Forth are factored VERY poorly. By the way, once you have a word like $CREATE (like CREATE but takes a string from the stack), then you need $: and $DEFER and $whatever_other_defining_words_you_care_about . If defining word syntax were postfix, and the notions of declaring the action class and creating the name were separate, then this problem wouldn't exist. > > c) An "adr len" string can be arbitrarily long. > Point c works only if you can capture the range of your address space in > a single stack item Which is sort of guaranteed, because the standard memory access operators (e.g. C@) take single-cell addresses. Extended address space acccess only appeared in the ANSI BASIS at the last meeting. More on that topic in a later posting. Mitch