Print

Print


Nelson H. F. Beebe skrev 2015-10-24 19.01:
> Manuel Blanco<[log in to unmask]>  proposes allowing spaces in LaTeX
> l3keys variable names to be ignored.
>
> I think that this is a BAD THING; Fortran did, and still does, it, but
> almost all programming languages designed since Fortran disallow it,
> and for good reasons.

I would say that is a false analogy. The problem in Fortran is not that 
variable names can be written with inserted spaces, but that there is no way 
of delimiting what you want to count as an identifier. A Fortran compiler 
will happily try any number of interpretations of a statement, picking 
anything that is legal syntax, and some of them are rather generous.

That problem does not exist for l3 keys: you already know from context that 
it is a key, you know where it begins, and you know where it ends. There is 
no alternative interpretation to compete with.

The problem with _not_ ignoring spaces in keys, as is the case in TikZ, is 
that it effectively treats spaces as an almost-letter, whereas in the 
majority of programming languages it is a separator with very low binding 
strength. While it is not inconsistent to preserve the spaces, it can often 
be confusing.

> TeX already has too many ambiguities such as:
>
> 	\foo \bar	execute \foo then execute \bar
> 	\foo \bar	execute \foo with \bar as its argument
> 	\foo \bar	assign \bar to \foo
>
> Making spaces insignificant would add to the mess.

Spaces very often are insignificant already -- just think of all the <one 
optional space> and <optional spaces>.

Lars Hellström