I want to construct a macro that, given a symbol 'foo
, creates a method called foo*
. How can I concatenate 'foo
and '*
?
There may be some confusion here from the different usages of the term "symbol" in Common Lisp and in Clojure. In Common Lisp, a "symbol" is a location in memory, a place where data can be stored. The "value" of a symbol is the data stored at that location in memory. In Clojure, a "symbol" is just a name.
List is a structure used to store a collection of data items. In Clojure, the List implements the ISeq interface. Lists are created in Clojure by using the list function.
Clojure (/ˈkloʊʒər/, like closure) is a dynamic and functional dialect of the Lisp programming language on the Java platform. Like other Lisp dialects, Clojure treats code as data and has a Lisp macro system.
[00:34] Keywords are a basic data type in Closure, just like strings, numbers, Booleans, or symbols. Symbols are what's often called identifiers in other languages. Keywords look like symbols except that they begin with a colon. [00:49] For example, greeting would be a symbol whereas :greeting would be a keyword.
(let [s (symbol 'test)]
(symbol (str s "*")))
(symbol (str 'foo "*"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With