Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

When to use # and # in clojure?


Asked by Abdullah Bernard on Nov 30, 2021 FAQ



Although some Lisps allow the read table to be extended by users, Clojure does not. The # is also used at the end of a symbol when creating generated symbols inside a syntax quote. # { … } - Set See # for additional details. # {…​} defines a set (a collection of unique values), specifically a hash-set. The following are equivalent:
In fact,
You have to mention the Clojure jar file, so that all Clojure-based classes will be loaded in the JVM. The ‘main.clj’ file is the Clojure code file which needs to be executed. Clojure can use many of the built-in functions of Java.
Besides, We call the invocation of function applying the function to data in Clojure or other functional programming language. The entire line of the code (....) is called a form in Clojure. It's also called expression in a general sense, but there is no real problem to use them interchangeably.
Just so,
Vars are created in the "current" namespace. The Clojure runtime tracks the current namespace in the var clojure.core/*ns*. The current namespace can be changed using the in-ns function. In addition to providing a naming context, namespace names also provide a convention for where a namespace’s code should be found for loading.
Moreover,
Symbols are used to bind names to values. a b my-cool-function nyncat: they are all symbols in Clojure. ' will prevent a form from being evaluated. We are doing this here because we want to treat symbols as data in order to pass them to type function. If you don't prepend a ' single quote, you are telling Clojure to resolve the symbol.