Hi Ed,

(I've mentioned everything in this email to you in private before, but I 
wanted to post it to the list as well.)

Eduardo Cavazos wrote:
> If you limit your scope to a single vocabulary, or even a hierarchy of
> vocabularies comprising a particular application, then it will be commonplace 
> to use the same "text" encoding throughout.
Well said, however dynamic scope is not a suitable solution. Consider 
the case where a word from vocab A calls a word form vocab B with a 
quotation calling a word from vocab A. So you have A -> B -> A. Now if 
the word from B does a with-encoding, the
innermost word from A will run with the wrong encoding. If each word in 
A and B does a with-encoding, it defeats the purpose.

What you want is a vocab-local variable,

VOCAB-LOCAL: encoding utf8

... "foo.txt" encoding [ ... ] with-file-reader

However a vocab-local variable is just a word!

IN: my-vocab

: encoding utf8 ;

... "foo.txt" encoding [ ... ] with-file-reader

You could even factor out the file name and encoding to one place:

: failing-tests "../failing-tests" utf8 ;

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

Reply via email to