William Tanksley, Jr wrote:
> Doesn't work in the version I downloaded just a week ago. But now I
> know to look under "io". No real problem.
>
You have to read the whole error message, not just assume it failed
irrecoverably:
( scratchpad ) \ <file-reader> help
<interactive>:1
\ <file-reader> help
^
Word not found in current vocabulary search path
"name" "<file-reader>"
The following restarts are available:
:1 Use the word IN: io.files : <file-reader> ( path encoding -- stream )
Type :help for debugging help.
( scratchpad ) :1
<file-reader> ( path encoding -- stream )
Parent topics: Reading and writing files, Basic file operations, Input
and outpu
t, Factor documentation
Vocabulary
io.files
Inputs and outputs
path a pathname string
encoding an encoding descriptors
stream an input stream
Word description
Outputs an input stream for reading from the specified pathname using
the given
encoding.
Errors
Throws an error if the file is unreadable.
Definition
USING: io.encodings kernel ;
IN: io.files
: <file-reader> ( path encoding -- stream )
swap (file-reader) swap <decoder> ;
> Well... maybe something could be better. One of the hard problems is
> knowing what to put in your USING: clause. Nobody ever shows that when
> showing code examples, but it's crucial, and a serious blocker for
> noobs. Maybe help could perform a search of some kind? I dunno.
If a word cannot be found in the current search path, the parser throws
an error but the error lists all vocabularies that have a word with this
name. You can invoke one of the restarts (like I did above with :1) to
use that vocabulary.
Slava
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk