Search the web
Sign In
New User? Sign Up
forth200x
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
RfD: FILE-SOURCE STRING-SOURCE and CLOSE-SOURCE   Message List  
Reply | Forward Message #233 of 425 |
Re: RfD: FILE-SOURCE STRING-SOURCE and CLOSE-SOURCE

Gerry said:

> To handle text from different types of input sources ANS Forth
> provides various words such as SOURCE SOURCE-ID REFILL >IN PARSE
> WORD SAVE-INPUT RESTORE-INPUT and the Forth 200X PARSE-NAME. In
> addition other parsing words such as CREATE ' etc work on the
> current input source.
>
> Many applications use the File-Access word set to handle text
> files and, having opened a file, can't immediately use words
> such as REFILL on that file. This is because the words ANS Forth
> provides for opening new input sources (INCLUDE-FILE and
> INCLUDED for files, EVALUATE for strings and LOAD for blocks)
> also invoke the Forth text interpreter. An unfortunate effect
> of this is that the application loses control to the system.

The big downside to this proposal is that it is a point solution
to a general problem. When it was proposed on c.l.f. I could not
define my real objections. One of my considerations was why we
(MPE) have not been asked for such a mechanism. The reason is
that we use a different I/O model.

We use what we call Generic I/O - a device is hidden behind an
opaque type that corresponds to a file handle. I really do not
want to have to create a raft of words such as SERIAL-SOURCE
(e.g. for Telnet) and WINDOW-SOURCE (e.g. for data entry). The
general problem is that of selecting the current input and
output, whether file or any other device.

In the Generic I/O world, a task just says which device the
input is to come from and all I/O words adjust automagically. I
have hesitated to issue such a proposal because it would
inevitably break many systems and require major internal changes
to them. However, I believe that Generic I/O of some form is the
correct solution to the problem addressed here.

In addition MPE Forths use the return stack for saving the
result of SAVE-INPUT.

Stephen
--
Stephen Pelc, stephen@...
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads




Mon Nov 10, 2008 1:59 pm

sfprem
Offline Offline
Send Email Send Email

Forward
Message #233 of 425 |
Expand Messages Author Sort by Date

I posted this RfD in comp.lang.forth about a month ago and was recently asked to post it in this group as well. See ...
yipperoo
Offline Send Email
Nov 9, 2008
5:22 pm

... That's certainly true for my Forth system - the one that is included in FirmWork's Open Firmware. It saves the input source specification on the return...
Mitch Bradley
wmb@...
Send Email
Nov 10, 2008
7:30 am

... The big downside to this proposal is that it is a point solution to a general problem. When it was proposed on c.l.f. I could not define my real...
Stephen Pelc
sfprem
Offline Send Email
Nov 10, 2008
1:59 pm

Stephen Pelc said... <snip> ... The FORTH, Inc. implentations do this as well. I'm not interested in implementing a separate stack for this. --Leon...
Leon Wagner
leon_wagner
Offline Send Email
Nov 10, 2008
3:04 pm

... The only implementation I know of that doesn't use the return stack is Gforth's implementation. It uses a field in the input buffer structure for ...
Bernd Paysan
berndpaysan
Offline Send Email
Nov 10, 2008
3:22 pm

The minutes of the 2008 meeting have now been published. See the web site for details. http://www.forth200x.org/forth200x.html -- Peter Knaggs...
Peter Knaggs
pknaggs
Offline Send Email
Nov 23, 2008
4:19 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help