EmilySeville7cfg · 2022-12-28 10:21
What resources do u recommend to read to do it? Or may be there is a good code example for this task?
cottasteel · 2022-12-28 10:47
Special forms in elisp are implemented as Lisp macros.
You can read about them below:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Macros.html
stuudente · 2022-12-28 12:51
special forms are different from macros
iirc most of the former are written in C
mnp · 2022-12-28 13:18
It's probably convenient to prototype and profile using macros, which might be fast enough. If more speed is really needed, it can be re-written in c and dynamically loaded.
https://emacsdocs.org/docs/elisp/Writing-Dynamic-Modules
nandryshak · 2022-12-28 13:39
Special forms in elisp are all implemented in C (and by definition they cannot be defined by the user), but macros are indeed the likely answer for OP, because this sounds like an [XY Problem](https://en.wikipedia.org/wiki/XY_problem) to me.
WikiSummarizerBot · 2022-12-28 13:40
**[XY problem](https://en.wikipedia.org/wiki/XY_problem)**
>The XY problem is a communication problem encountered in help desk, technical support, software engineering, or customer service situations where the question is about an end user's attempted solution (Y) rather than the root problem itself (X). The XY problem obscures the real issues and may even introduce secondary problems that lead to miscommunication, resource mismanagement, and sub-par solutions. The solution for the support personnel is to ask probing questions as to why the information is needed in order to identify the root problem X and redirect the end user away from an unproductive path of inquiry.
^([ )[^(F.A.Q)](https://www.reddit.com/r/WikiSummarizer/wiki/index#wiki_f.a.q)^( | )[^(Opt Out)](https://reddit.com/message/compose?to=WikiSummarizerBot&message=OptOut&subject=OptOut)^( | )[^(Opt Out Of Subreddit)](https://np.reddit.com/r/emacs/about/banned)^( | )[^(GitHub)](https://github.com/Sujal-7/WikiSummarizerBot)^( ] Downvote to remove | v1.5)
MitchellMarquez42 · 2022-12-28 18:14
Good bot
vfclists · 2022-12-29 15:26
> Special forms in elisp are all implemented in C (and by definition they cannot be defined by the user)
Does this apply to all LISPs?
It may not be an XY Problem.
There is always the assumption that the user may be on the wrong path.
Sometimes the user is following a path of learning and exploration and doesn't want to be taught, but wants to follow the current train of thought to its to a fruitful logical conclusion even though it may not be the optimal one to those with more knowledge of the field.
P.S I have no idea what a special form is.
nandryshak · 2022-12-29 15:52
> Does this apply to all LISPs?
It's really a case of semantics. "Special form" generally refers to a primitive form described by the language standard. If all you want is to control argument evaluation, macros will like give you all that you want.
The Common Lisp standard allows for "special forms" to be implemented as macros if the implementer wants to. Most implementations also locked the redefinition of special forms in the COMMON-LISP package (i.e. the default namespace).
Clojure implements a lot of special forms as macros, but some *must* be primitives implemented in Java (e.g. async).
At the end of the day, everything described in the Emacs manual as a "special form" is defined and implemented as a primitive in C. Therefore, the user cannot define any more.