Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!dwp From: dwp@willett.pgh.pa.us (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: Vocabularies Message-ID: <1561.UUL1.3#5129@willett.pgh.pa.us> Date: 20 Aug 90 01:53:07 GMT References: <1219@acf5.NYU.EDU> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 49 In <1219@acf5.NYU.EDU>, sabbagh@acf5.NYU.EDU (sabbagh) writes: > CREATE (and other words) can be easily refactored as "take next word from > input stream then invoke $CREATE" which takes a string argument. THis > means that strings would have to be standardized. (Are you listening > ANSI dudes?). Agreed! HERE! HERE! :-) Does it have sufficient existing practice? I suspect not. :-( :-( > I do not have any problems with the mixed-fixed nature of Forth; for those > who are real purists, check out Postscript which is an entirely postfix > language. It uses the concept of anonymous code blocks delimited by {} then > > {...(code)...} /foo def > > would define a new word named foo. This works too, but I like Forth better. I would agree if the mixed-fixed parts of Forth were actually built from accessible post-fix forms, as in your CREATE $CREATE example. I don't think I'd want to write code in the postscript style (i'm not sure of course, not having tried it), but I would certainly like to be able to write code that itself writes code, and that would be much easier with the $CREATE form. > What are vocabularies? They are lists of (key,value) pairs! Why not > define them abstractly, simply by having each vocabulary provide its own > words for creation, deletion, listing and finding such pairs in its own > internal structure? Also, allow each vocabulary to decide what a number > is. Vocabularies could then be kept on a stack, and the inner interpreter > would call the FIND word for each vocabulary in the stacked order, until > one of them recognizes the word. This is the most general solution to > the vocabulary issue, especially since this would be transparent to the > user, most of the time. It also addresses the issue of what to do if > you want to add new number types, literals, etc. to Forth. Ok, but how does the inner-interpreter find the FIND words? Perhaps they must be the first word in the vocabulary? (DEFER would be useful in that case). I think your earlier point about the history of Forth is relevant here. The ANSI "process" is not supposed to be a creative effort, its supposed to be a consensus making effort. I think your idea about vocabularies, which is similar to other ideas I've seen, makes sense on paper. I think it would actually work in practice. But that isn't good enough for ANSI. It has to have really been done. -Doug --- Preferred: ( dwp@willett.pgh.pa.us OR ...!{sei,pitt}!willett!dwp ) Daily: ...!{uunet,nfsun}!willett!dwp [last resort: dwp@vega.fac.cs.cmu.edu]