I want to define a macro such that given a string it defines two
variables whose name contain that string

In Emacs, I can do that as it follows

#+HEADER: :results value
#+HEADER: :results verbatim
#+BEGIN_SRC elisp
(defmacro my-define-variables (string)
  `(progn
    (defvar ,(intern (concat string "-1")) "one")
    (defvar ,(intern (concat string "-2")) "two")))

(my-define-variables "hello")

(list hello-1 hello-2)
#+END_SRC

#+RESULTS:
#+begin_example
("one" "two")
#+end_example

How to do this in Guile? I want to use this macro in my system
configuration.

Reply via email to