Distinctive traits of the functional languages

后端 未结 7 1711
时光取名叫无心
时光取名叫无心 2021-01-30 14:45

It is known that all functional languages share some basic properties like using functions as basic building block for programs with all the consequences like using recursion in

相关标签:
7条回答
  • 2021-01-30 15:41

    When you say code as data you are referring to a language where the code is represented in a data structure. This is referred to as Homoiconicity and it usually only true for languages that are lisp dialects or something close to it. Haskell, Erlang and Scala are not Homoiconic, Clojure is.

    Clojure's fundamental differentiators are:

    1. It has a Software Transactional Memory system, which makes shared state concurrent programming easier

    2. It is a Lisp, unlike Haskell or Erlang, therefore all code is data, which allows you to make what look likes changes to the language itself at runtime through the macro system

    3. It runs on the JVM, which means you have direct access to all Java libraries

    4. Clojure data structures implement Java interfaces such as Collection, List, Map, Runnable and Callable where appropriate. Strings are just Java Strings, Numbers are Java Integers and Doubles. This means Clojure data structures can be passed directly to Java libraries without any bridging or translation

    0 讨论(0)
提交回复
热议问题