Hi,

On Oct 22, 4:22 pm, Tzach <[email protected]> wrote:

> I’m writing a small facility which get vector of vectors of names
> (strings) and print them in a special format.
> Something like (foo [[“aname” “a-different-name”] [ “oneMoreName”]])
> This works fine, but make it hard to write all the quotations when
> many parameters are used.
>
> What is the simplest way to define foo as
> (foo [[aname a-different-name ] [oneMoreName]]) ?
>
> Is  macro required? (I guess it is)

It is, but a simple one. Rename your foo function to foo* and create a
simple macro called foo like that:

(defmacro foo
  [vec-of-symbols]
  `(foo* (quote ~vec-of-symbols)))

There you go. (Of course you must now handle Symbols in your foo* star
function instead of Strings...)

Sincerely
Meikel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to