Clojure

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
  
 
The concepts and terminology used in Clojure includes "arity", the number of parameters a function takes (you can define a function with different functionality depending on what arity it is given in a particular invocation) and "closure", referring to a function enclosing temporary functions and other objects that are only in scope within the outer function, but have continued presence via their use in the outer function which can be invoked elsewhere.
 
The concepts and terminology used in Clojure includes "arity", the number of parameters a function takes (you can define a function with different functionality depending on what arity it is given in a particular invocation) and "closure", referring to a function enclosing temporary functions and other objects that are only in scope within the outer function, but have continued presence via their use in the outer function which can be invoked elsewhere.
 +
 +
As the implementations of Clojure in common use are built on Java, there are syntax conventions within Clojure for invoking Java objects and methods in a manner consistent with Clojure structure, so that application packages can combine Clojure and Java code. Java methods are still not Clojure functions, and can't be passed around in the same manner, though they can be wrapped in Clojure functions for such use.
  
 
'''.clj''' is the normal extension for Clojure programs, and '''.edn''' is also found in reference to Extensible Data Notation, a format used to express data used by Clojure (including programs themselves, which are merely a form of data).
 
'''.clj''' is the normal extension for Clojure programs, and '''.edn''' is also found in reference to Extensible Data Notation, a format used to express data used by Clojure (including programs themselves, which are merely a form of data).

Revision as of 20:53, 17 June 2022

File Format
Name Clojure
Ontology
Extension(s) .clj, .edn

Clojure is a programming language based on LISP. It is designed for multithreaded applications with mutable and immutable data structures, and has implementations that run under Java or JavaScript. As with other Lisps, Clojure treats program code like data, making self-modifying code easy to develop. Functions in Clojure can be passed as arguments, and returned as values, by other functions.

While Clojure is a compiled language rather than an interpreted one, so there is no such thing as a "Clojure interpreter", in practice there are command line shells freely available that immediately compile any Clojure expressions typed in immediate mode and output their result, giving the "instant gratification" useful in climbing the learning curve when getting started in the language, a characteristic it has in common with old-time home computer BASICs as well as some newer languages like Python.

The concepts and terminology used in Clojure includes "arity", the number of parameters a function takes (you can define a function with different functionality depending on what arity it is given in a particular invocation) and "closure", referring to a function enclosing temporary functions and other objects that are only in scope within the outer function, but have continued presence via their use in the outer function which can be invoked elsewhere.

As the implementations of Clojure in common use are built on Java, there are syntax conventions within Clojure for invoking Java objects and methods in a manner consistent with Clojure structure, so that application packages can combine Clojure and Java code. Java methods are still not Clojure functions, and can't be passed around in the same manner, though they can be wrapped in Clojure functions for such use.

.clj is the normal extension for Clojure programs, and .edn is also found in reference to Extensible Data Notation, a format used to express data used by Clojure (including programs themselves, which are merely a form of data).

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox