summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/followingup/followingup-rejected.tex
blob: f357c0ae5364a31d9c1a2f18bb321d365af8da13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% language=us

\startcomponent followingup-rejected

\environment followingup-style

\startchapter[title={Rejected}]

\startsection[title={Introduction}]

During the development of \LUATEX\ some extensions were considered but rejected
after some experiments. I already forgot about some that were tried the last
decade. I will not discuss what has been added already to \LUATEX.

\stopsection

\startsection[title={Conditionals}]

The \LUATEX\ manual describes a few conditional primitives that were added. One
thing I played with was a native definer, think of \type {\idef} but in the end
rejected it, because in practice it was seldom needed. Another useful one would
be \type {\ifnothing} but the current implementation of \type {\ifx} is already
pretty efficient so there is nothing to gain here. Another rejected one is \type
{\ifxcase} which takes a token and compares that with a sequence, like

\starttyping
\ifxcase\foo\alpha
\or\beta
\or\gamma
\else
\fi
\stoptyping

As this was never available, in \CONTEXT\ already different strategies were
followed so I could only find a few places where this could make code more
readable. But who knows, I might change my mind when I split the code base and can
adapt code accordingly although it doesn't make much sense for the more high
level modules because it would only affect a few lines and maintaining duplicate
files is no fun. \footnote {But playing with extensions that make for better code
{\em is} fun.}

\stopsection

\startsection[title={Dimensions}]

A primitive that returns the height plus depth would make sense (\type {hd}) but
one can easily define one and the gain can be neglected. So, for now this has
been rejected. Also, one can use the token scanners to implement that kind of
primitives but of course that then does have a penalty in terms of performance.
\footnote {Okay, in the end I decided to just add a primitive for this, but only
as part of a larger set of box related primitives.}

\stopsection

\startsection[title={The something}]

I played a bit with intercepting \type {\the} so that we could define commands
that also respond to this expander. It didn't work out well because full
expansion happens, even with protected macros:

\starttyping
\protected\def\foo{...] \the\foo
\stoptyping

We just have to accept this and it's no big deal.

\stopsection

\startsection[title={Primitives}]

Occasionally I'm wondering if we should have a way to flag primitives and macros
as being frozen but in the end it might not pay off. At some point I decided that
at least the \type {\primitive} and \type {\ifprimitive} could go away as they
are not really working as expected. It's better to have nothing than something
bad. Also, we can easily clone the whole set of primitives in a new namespace
with \LUA\ if we want. \footnote {But \unknown\ in the end we got something else
back.}

\stopsection

\stopchapter

\stopcomponent