home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!ub!dsinc!netnews.upenn.edu!meded6.med.upenn.edu!user
- From: (Randolph M. Peters)
- Newsgroups: comp.lang.forth
- Subject: Pocket Forth: question about doer/make and interpret
- Message-ID: <98282@netnews.upenn.edu>
- Date: 18 Nov 92 22:17:53 GMT
- Sender: news@netnews.upenn.edu
- Followup-To: comp.lang.forth
- Organization: University of Pennsylvania
- Lines: 45
- Nntp-Posting-Host: meded6.med.upenn.edu
-
-
- I am a very satisfied pocket forth user (many thanks to its creator for a
- shareware product that is well thought out and enjoyable to use), but I am
- having some difficulties with two problems.
-
- First, I've been trying to create a doer/make construct similar to
- that described in the book THINKING FORTH (a truly excellent book for both
- programming in general and the forth paradigm in particular). The
- obstacles? Well, the alternative code samples (F-83, figForth, etc models)
- provided make some assumptions about compilation. Pocket Forth code is
- compiled directly to machine language, so words inside a colon definition
- are not compiled as addresses (which are taken off in sequence by an
- address interpreter) but rather directly as machine language JSR routines.
- I am unsure how the return stack is supposed to operate in Pocket Forth if
- this is the case. Additionally, there seems to be no easy way to obtain the
- pfa of a word (ie, no body> or pfa> command).
-
- The second problem involves invoking the standard command interpret
- (which is supposed to begin interpreting the contents of the text input
- buffer). When I create a word which EXPECTs a line of text into the TIB and
- then INTERPRETs it, it seems to start interpretation partway through the
- buffer. There is no user variable provided for IN> (marking the position in
- the input stream). Now, according to the glossary provided with the
- software, the token "{cr}" (ie, the token consisting of an ascii 13) will
- reset the return stack and the input stream. But there's no way to generate
- this token, since cr's are intercepted by the event handler. I thought I'd
- be able to find the cfa of this token by searching for a pascal-style
- string consisting of a 1 in the length byte and ascii 13 in the second
- byte, but this doesn't work.
-
- Again, I greatly enjoy using Pocket Forth and would strongly recommend
- it to anyone thinking of using Forth on the Mac. It's a great learning
- tool. However, I would appreciate any tips on these two problems. I don't
- have an e-mail address, so please post answers to this net. I believe that
- a discussion of these problems could be informative to most forthers since
- there seems to be a dearth of sample code on this newsnet at present.
-
- THanks in advance for your help,
-
- Randolph M. Peters
- Medical Clinic, Suite C,
- 3rd floor Silverstein Building
- Hospital of the University of PA
- 34th and Spruce Streets,
- Phila, PA 19104
-