Timeline for What are the practical benefits of LISP like syntax which Clojure uses over Java like syntax of Scala?
Current License: CC BY-SA 3.0
21 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 5, 2016 at 21:17 | comment | added | Quonux | so what, functional languages don't have to be pure languages...Functional languages are called as such because functions are first class citizens, point. | |
| Feb 5, 2016 at 18:44 | comment | added | Florian Margaine | @Quonux programmers.stackexchange.com/questions/193864/… | |
| Feb 5, 2016 at 18:23 | comment | added | Quonux | @FlorianMargaine Since when are functions threated as first class citizen in C(++)? You can't pass functions around and modify them like in a functional language (FP). You just can pass pointer at the functions around (big difference), to modify the function you need to write another functions and call the callee, thats not functional programming. Likewise you can't store without dirty hacks a list of functions into an array or hashmap (like variables). | |
| Jan 31, 2016 at 7:06 | comment | added | Didier A. | @FlorianMargaine Let me be more specific. Lisp was the first language to provide all the necessary constructs to enable a functional style of programming. Lisp predates C. Lisp was also the first dynamic language. Lisp was never exclusively functional, it also provided constructs that enabled imperative and procedural programming, and later OOP and constraint programming. Most functional languages are not purely functional, you can still use them to code in a functional style. Clojure is more functional than Common Lisp, but still not pure. Purity is about what you can't do, not what you can. | |
| Jan 31, 2016 at 6:50 | comment | added | Didier A. | @FlorianMargaine Lisp was the first functional language. What you want to say is that Lisp is not only functional, but it very much is functional. In Lisp, you actually can not write imperative code without a macro. Expressions take inputs and return values. Procedures do not need to return value, can be void. This is a big difference. Where Lisp also allows imperative programming is in that functions can get input from other places than their arguments. In C, a function pointer does not have to return a value, it is only a controlled goto. | |
| Jun 10, 2013 at 15:51 | comment | added | bstamour | Lisp is a multi paradigm language, sort of like C++. It allows you to write procedural code, OOP code, functional code (C++ allows this to an extent), etc. Lisp is definitely not pure-functional, but it offers tools to write code in a functional style should you choose to. | |
| Apr 4, 2013 at 15:14 | comment | added | Vatine | @JimmyHoffa Lisp is, in general, not a "pure functional language". It encourages 9and makes it relatively easy) to write code in a functional style, but provides (specifically in Common Lisp, but probably in other languages in the family) a wide variety of imperative tools to use when that makes expressing your code easier. | |
| Apr 4, 2013 at 15:14 | comment | added | Florian Margaine | I mean, come on, read the Wikipedia's definition. "It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state." Lisp uses state all the time. What more do you need? And I'm going to edit wikipedia's page about Lisp, since this is false. Most recognized Lisp hackers agree that Lisp isn't a functional language. | |
| Apr 4, 2013 at 15:13 | comment | added | Jimmy Hoffa | @FlorianMargaine Wikipedia page for LISP and ML both list functional in their paradigm too... And are you really going to claim ML isn't a functional language? LISP and ML are the basis for the most common types of functional languages. In your definition other than Haskell derivatives, Erlang and esoterics, there are no functional languages... | |
| Apr 4, 2013 at 15:10 | comment | added | Florian Margaine | @JimmyHoffa according to Wikipedia's definition, purity is a requirement. "avoids state and mutable data" means exactly that. | |
| Apr 4, 2013 at 15:09 | comment | added | Jimmy Hoffa | @FlorianMargaine if you say purity is a requirement of functional programming, then you're saying ML isn't a functional language either... | |
| Apr 4, 2013 at 15:07 | comment | added | Florian Margaine | Alright, "Lisp is as functional as C" was an exageration. However, it is still true that Lisp is far from being a functional language, because it mutates data and uses states all the time. And also because you usually write Lisp in a procedural way. | |
| Apr 4, 2013 at 15:04 | comment | added | Florian Margaine | "... and avoids state and mutable data." <- Which is pretty much what defines functional languages. Lisp is everything but side-effect free. | |
| Apr 4, 2013 at 15:02 | comment | added | Jimmy Hoffa | @FlorianMargaine I was referring to the mathematical definition for functional as it is based on math. But if you go the technical definition; I would say having arbitrary depth lexical closures is a pretty strong indicator of a functional language, which C doesn't have. As per wikipedia though "Functional Programming" refers to being rooted in math: "In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions" en.wikipedia.org/wiki/Functional_programming | |
| Apr 4, 2013 at 14:46 | comment | added | Florian Margaine | @JimmyHoffa Lisp is as procedural as it can get. If any language with first-class functions is "functional", then C is one too (thanks to function pointers). And Lisp is just as functional as C. | |
| Apr 4, 2013 at 14:21 | comment | added | Jimmy Hoffa | @FlorianMargaine LISP is not a functional language? I'm sorry, but whaaaaa? A language developed to be the programmatic form of lambda calculus and you're saying it's not functional? How do you figure? | |
| Apr 4, 2013 at 13:05 | comment | added | Amogh Talpallikar | @MattFenwick: is there any advantage of quoted list over vectors ? | |
| Apr 4, 2013 at 12:00 | comment | added | Florian Margaine | The fact that lisp is functional has nothing to do with the self modifying code trick. Besides, Lisp is not a functional language. | |
| Apr 4, 2013 at 11:35 | review | First posts | |||
| Apr 4, 2013 at 11:44 | |||||
| Apr 4, 2013 at 11:33 | comment | added | user39685 |
Yes, Lisps do have syntax in multiple forms: 1) numbers, strings, symbols, lists, etc.; 2) special form syntax -- such as define <symbol> <form> or lambda <parameter list> <body forms>; 3) macro syntax, both reader macros and the other kind; 4) syntax extensions such as Clojure uses, i.e. [...] for vectors, {...} for object literals, etc. So it's really false advertising to say that Lisps are syntax-free.
|
|
| Apr 4, 2013 at 11:16 | history | answered | Quonux | CC BY-SA 3.0 |