Leonid Shifrin once wrote (excerpted):
(
Unevaluated
) is one of a very few "magic symbols", along withSequence
andEvaluate
- these are deeply wired into the system and can not be easily replicated or blocked, unlikeHold
- in that sense,Unevaluated
is more fundamental.
HoldPattern
is a normal (usual) head withHoldAll
attribute for the purposes of evaluation, but its magic shows in the pattern-matching: it is invisible to the pattern-matcher, and is very important ingredient of the language since it allows pattern-matcher to be consistent with the evaluation process.
David B. Wagner writes:
The symbols
Evaluate
,Unevaluated
, andSequence
are magic cookies. This is a whimsical term used by computer scientists to refer to any type of value that has special significance to the software system of which it is a part. The behavior of these symbols is not the result of any values or attributes they possess; rather, it is "wired into" the kernel. This implies these behaviors simply cannot be altered, nor can they be duplicated.
These are fundamental to the language but they are not widely recognized as such. I have never attempted to make an exhaustive list of these "magic Symbols" but I think it would be useful to the community to have one.
What are all the "magic" Symbols in the Mathematica language?
What makes each of these Symbols special?
- I believe these should be considered distinct from atomic objects, which while also being "deeply wired into the system" and "not easily replicated" are a form of data types with special handling.
A related question with a somewhat different scope:
Catch
/Throw
orCheck
/CheckAbort
/CheckAll
to fall into the "magic" category? They pretty much need special kernel hooks to function correctly, but it feels like a different level of magic thanUnevaluated
etc. $\endgroup$Catch
andThrow
could be written - they're non trivial and would involveCatch
rewriting the entire expression given as its first argument - but LISP macros are written do that kind of thing a lot and I don't think there's anything special about them here. I believe theCheck
family can be written as well. (For the curious, Let Over Lambda is probably the best book on LISP macros ... ever!) $\endgroup$Update
as magic? $\endgroup$