all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* implementing a reader macro
@ 2022-07-22 18:40 Ag Ibragimov
  2022-07-22 20:32 ` Stefan Monnier
  2022-07-22 20:51 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Ag Ibragimov @ 2022-07-22 18:40 UTC (permalink / raw)
  To: emacs-devel


How difficult is it to implement a new reader macro for Elisp?
The one I particularly wish to be ported from Clojure is the "discard
macro" - `#_`. What it does is that it ignores the next form completely.

e.g., 
#+begin_src clojure
    #_(list 1 2 3)

    (list 1 #_2 3)
#+end_src

And it can be stacked to omit multiple forms:

#+begin_src clojure
  (foo 1
     #_#_(bar)       ; both, (bar) and 
     (zap "zop"))    ;       (zap "zop") will be ignored
#+end_src

It is a very nice way of (usually temporarily) commenting out sexps
without disrupting the structure too much. Of course, we can employ nice
tricks such as one described by Malabarba:
http://endlessparentheses.com/a-comment-or-uncomment-sexp-command.html
But wouldn't it be nice to have something even better?



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-22 23:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-22 18:40 implementing a reader macro Ag Ibragimov
2022-07-22 20:32 ` Stefan Monnier
2022-07-22 21:18   ` Jose A. Ortega Ruiz
2022-07-22 22:12   ` Ag Ibragimov
2022-07-22 23:07     ` Stefan Monnier
2022-07-22 20:51 ` Lars Ingebrigtsen
2022-07-22 22:16   ` Ag Ibragimov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.