As we know, John McCarthy build a whole programming language, the name of that language is Lisp, but why it is call Lisp; Lips stands for, List Processing. The reason it is call Lisp it is because one of its key ideas was to use a simple fata structure called list for both, code and data.
In our course of Programming Languages, we are seeing a flavor of Lisp but not Lisp per se. Clojure is a functional programming that has its bases in the Lisp definition. Nevertheless, Clojure is more understandable than Lisp. In the next lines I will explain why I think this.
Lisp has seven primitive operators where we can find the following ones:
· Atom: sequence of letters, or a list of zero or more expressions.
· Quote: it returns x, in Clojure and Lisp it has a macro to express the same thing by only using the char “ ‘ “.
· Eq: verifies if the two arguments are atoms or lists.
· Car: returns the first element of the given list (in Clojure this function is first).
· Cdr: returns the list without the first element of the given list (in Clojure this function is rest).
· Cons: adds the element x to the beginning of the list.
· Cond: it is a conditional that evaluates the expressions given.
In the next pages of the paper the author explains the different ways of how you can denote functions and all the related stuff for this subject. Nevertheless, Clojure is miles away simpler and readable than the common Lisp at least when we talk about functions, because I did not understand a thing of the function definition.
However, I agree with the author that the functional programming languages are the future of the developing because of all the features that functional programming haves, like the immutability of the data or the data persistency. Finally, it is not simple to understand Lisp or Clojure but if you dedicate some time to study the language you will find it funny and powerfull.
No hay comentarios:
Publicar un comentario