[Dev-luatex] .BEILMOPS or how I stopped worrying and love Open Source

Jonathan Sauer Jonathan.Sauer at silverstroke.com
Wed Dec 12 10:44:18 CET 2007


[\unexpanded vs \detokenize]

> > Well, currently it makes a difference, three actually:
> >
> > 1.	\unexpanded introduces "IMPOSSIBLE."
> Hm.

Addition: Only in the very specific situation created by the format
weird_format.tex (see my mail from 09:06 this morning).

> > 2.	\unexpanded introduces spaces after control sequences.
> Why wouldn't \detokenize do the same?  Wait, it does:
> > At least in the context of \directlua.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> I guess that this may be the real reason.

I thought a bit about this, and I think that it is quite useful if
\detokenize does not introduce spaces when used in \directlua, as
opposed to \unexpanded, since sometimes (i.e. when used as a set
in lpeg.S) spaces are completely undesired.

Of course, in these situations \string could be used as an alternative.
But since \detokenize is equivalent (at least as I understand it) to
prefixing each token with \string, \detokenize should not introduce
spaces. IMO.

> >> >> btw, if you change \unexpanded by \detokenize you get 
> >> >> the desired result
> >> >
> >> > I know.
> >> 
> >> Oops.  Why would that be?
> >
> > Because of a bug? :-)
> I should think so.  Not sure whether this behavioral difference is
> intended, but it certainly feels wrong to me.

I think we are talking about slightly different things: You about the
introduction of spaces by \unexpanded and \detokenize, me about the
"IMPOSSIBLE.". The latter most certainly is a bug :-)

> -- 
> David Kastrup, Kriemhildstr. 15, 44793 Bochum


More information about the dev-luatex mailing list