I'm currently getting into Literate Programming with org-mode in Emacs. One of the key features to make it tractable as a programming style is macros. I would like to be able to do something like this:
#+BEGIN_SRC emacs-lisp :tangle yes :noweb yes <<set-name(name="John Doe",email="email@example.com")>> #+END_SRC #+NAME: set-name #+BEGIN_SRC emacs-lisp :tangle no :macro yes :var name="" :var email="" (setq user-full-name name user-mail-address email) #+END_SRC
And to have the tangled result be
(setq user-full-name "John Doe" user-mail-address "firstname.lastname@example.org")
Currently this is possible in lisp languages like so:
#+NAME: set-name #+BEGIN_SRC emacs-lisp :tangle no :var name="" :var email="" `(setq user-full-name ,name user-mail-address ,email) #+END_SRC
However, it doesn't appear that this is possible with other languages with lesser macro features, like Java for example.
Is there a pre-existing way to do this kind of variable-substitution-based macro expansion in org-mode? If not, where would be a good place to start with implementing it?