On 9/23/2025 11:14 AM, wit...@gmail.com wrote:
I am seeing some other issues with `\read` as well. For example, `\def\first{hello  world}` (notice the two 
spaces) will store 11 tokens "hello␣world" in `\first` but storing `hello  world` in a text file 
named `example.txt` and reading that file with `\newread\example \openin\example=example.txt \read\example 
to\second` in LuaMetaTeX stores 13 tokens "hello␣␣world\n" in `\second`. LuaTeX and other TeX 
engines would store just 12 tokens "hello␣world\n". This is less of an issue than the one described 
in the original post and can likely be fixed by using `\scantokens` on `\second`.

On my machine from this:

\starttext

\newread\example
\openin\example=example.txt
\read\example to\hello
\read\example to\world
\closein\example

(\meaningfull\hello)

(\meaningfull\world)

[\hello\ \world]

\stoptext

I now get:

(global macro:{hello})
(global macro:world)
[hello world]

For

{%
hello}
world

But I used a patched version of \read that is not yet uploaded.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to