3 ms·
Lisp imposes almost no structure, I'm a lisp novice, but doesn't it impose functional composition? And isn't that some mighty structure?
by pohl 16y ago
Lisp imposes almost no structure,
I'm a lisp novice, but doesn't it impose functional composition? And isn't that some mighty structure?
- sedachv 16y agoOne of my favorite things about Common Lisp is that it has gotos and stack unwinding to dynamically (at runtime) determined points: http://www.lispworks.com/documentation/HyperSpec/Body/s_go.htm http://www.lispworks.com/documentation/HyperSpec/Body/s_go.h... http://clhs.lisp.se/Body/s_tagbod.htm http://clhs.lisp.se/Body/s_tagbod.htm http://www.lispworks.com/documentation/HyperSpec/Body/s_throw.htm http://www.lispworks.com/documentation/HyperSpec/Body/s_thro...
- pdelgallego 16y agoCLisp, for example, is not a functional language in the sense of ML language or Haskell. CLisp is a multi-paradigm language. You can use it in a OOP or a functional style. You can even use its OO features in a functional way and viceversa. E.g Objects are poor's people closures. [1] [1] http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent http://c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent
- jpr 16y agoAlso, CLisp is not a language, it's an implementation of a language named Common Lisp: http://www.gnu.org/software/clisp/ http://www.gnu.org/software/clisp/ (It's common misconception, and a confusing name)
- xyzzyz 16y agoHate to be pedantic, but there is no such language as CLisp. There is Common Lisp language, commonly abbreviated to CL, and CLisp is the name of one of its implementations -- the other popular ones are SBCL, Clozure CL, Allegro CL, to name a few. One should not identify Common Lisp the language with CLisp the implementation, especially since it is not the fastest or the most pleasant one.
- francoisdevlin 16y agoUse closures to create a simple object system. You'll see that you can quickly create systems ranging from Java-esque rigidity to smalltalk message passing to javascript prototypes pretty quickly. Then you can start making your own trade offs in object systems. This is something most people (including lisp programmers) don't do daily, and it gets you wondering about some very abstract things. The imposed structure of say, Python (or most other languages), limits you to thinking about "only" the problem domain. For most people (again, including lispers), narrowing the mental focus helps a lot.
- zck 16y agoNope, it doesn't. It may encourage it, but by no means is it required. Common Lisp was the first standardized object oriented language, actually (https://secure.wikimedia.org/wikipedia/en/wiki/Common_Lisp_Object_System https://secure.wikimedia.org/wikipedia/en/wiki/Common_Lisp_O...). You can write Lisp code that's as imperative as Java. Whether this is good or bad is left up to the reader.
- bhrgunatha 16y agoYou could argue that it imposes a fanatically singular structure which is paradoxically what makes it so incredibly flexible.