Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!sdd.hp.com!mips!pacbell.com!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: FPC forth????????? Message-ID: <2745.UUL1.3#5129@willett.pgh.pa.us> Date: 13 May 91 11:56:33 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 81 Category 1, Topic 21 Message 99 Sat May 11, 1991 R.BERKEY [Robert] at 10:55 PDT To: David Rogers Re: F-PC problems > \ The following produces some garbage at run time - see test run below > \ > > create buf 80 allot > variable bufcount > > : readline > buf 20 EXPECT > span @ bufcount ! > ; > > \ The following works as expected > \ > \ > \ > \ > > : readline2 > buf 20 (EXPECT) > span @ bufcount ! > ; > > > Here's what happens: > > load > Loading.. ok > readline This is a test!!! ; R> <- What? > ok > ok > readline2 This is a test!!! ok > Hi, David. I have F-PC 3.50 and I wasn't able to duplicate the problem. I created a file with the definitions of readline and readline2 . Then on the command line, I typed: readlineThis is a test!!! ; and it looked fine. BUF and BUFCOUNT were correct. In F-PC, EXPECT is a deferred word that is deferred with XEXPECT for the entering of keyboard command lines. Typing SEE EXPECT will report the presence of XEXPECT in EXPECT . (EXPECT) is a conventional implementation of EXPECT , and if it solves the problem, by all means, use it. XEXPECT is a more complicated version of EXPECT , with colored background, etc. The problem may have to do with reentrancy of XEXPECT , which isn't properly reentrant. The interpreter's error message: R> <- What? is also puzzling. I suspect that the error message is itself in error, a side effect of the reentrancy problem. XEXPECT has a temporary buffer, and it may be that the interpreter is trying to interpret text entered as a part of READLINE . For a quick fix, you might try adding a QUIT at the end of the definition of READLINE , as QUIT restarts the interpreter. Robert ----- This message came from GEnie via willett. You *cannot* reply to the author using e-mail. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, etc.). Report problems to: dwp@willett.pgh.pa.us _or_ uunet!willett!dwp