Johan Bockg=C3=A5rd <=
;
bojohan@gnu.org> schrieb am So.,=
24. Mai 2015 um 02:27=C2=A0Uhr:
Philipp =
Stephani <p.s=
tephani2@gmail.com> writes:
> The pcase help says that SELFQUOTING is a UPattern.=C2=A0 This works f=
or
> e.g. t
Actually, t is not self-matching; it is equivalent to _ (match
anything). But this "feature" seems to be undocumented.
Thanks, I really wasn't aware of that!=
nil and t should work as QPatterns (they are atoms), but the documentation=
about UPatterns seems less clear. Specifically, 'self-quoting' doe=
sn't seem to be an established or widely known term.=C2=A0 The Elisp ma=
nual talks about 'self-evaluating forms' (anything that is not a li=
st or symbol), but 'self-quoting' in the `pcase' sense seems to=
be a more comprehensive construct as it also includes keywords. The Elisp =
manual talks about 'symbols acting like self-evaluating-forms' in t=
he following paragraph:
=C2=A0 =C2=A0The symbols `=
nil' and `t' are treated specially, so that the value
of =
`nil' is always `nil', and the value of `t' is always `t'; =
you
cannot set or bind them to any other values.=C2=A0 Thus, thes=
e two symbols
act like self-evaluating forms, even though `eval=
39; treats them like any
other symbol.=C2=A0 A symbol whose name =
starts with `:' also self-evaluates
in the same way; likewise=
, its value ordinarily cannot be changed.
So this =
definition includes both keywords and nil and t. Ideally, 'self-quoting=
' in the pcase sense would have the same meaning (right now it includes=
keywords but not nil or t). The documentation should really enumerate all =
the forms exhaustively to make the definitions clearer.