Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the equivalent of Clojure's "do" in Common Lisp?

That is, a form that evaluates child forms in order and returns the last evaluated value,e.g.

(do (println "Hello World") 3) => 3
like image 627
Cubic Avatar asked Nov 19 '12 09:11

Cubic


People also ask

Is clojure a Lisp-1?

Since Clojure is a Lisp-1, (global) functions can be dynamically rebound (if they are marked as dynamic).

Is clojure similar to Lisp?

Clojure is a member of the Lisp family of languages. Many of the features of Lisp have made it into other languages, but Lisp's approach to code-as-data and its macro system still set it apart. Clojure extends the code-as-data system beyond parenthesized lists (s-expressions) to vectors and maps.

Is Common Lisp faster than Clojure?

Common lisp comparatively faster than Clojure as it uses compilers like SBCL which makes common lisp faster than C programming or any other low-level programming language and it also provides a variety of different libraries for different concepts that can be included in the program for easy execution.

Why is Clojure not a Lisp?

Clojure is a Lisp-1 and is not intended to be code-compatible with other dialects of Lisp, since it uses its own set of data structures incompatible with other Lisps. As a Lisp dialect, Clojure supports functions as first-class objects, a read–eval–print loop (REPL), and a macro system.


1 Answers

It's called progn.

Special Operator PROGN

Syntax:

progn form* ⇒ result*

Description:

progn evaluates forms, in the order in which they are given.

The values of each form but the last are discarded.

like image 191
Chris Taylor Avatar answered Sep 27 '22 21:09

Chris Taylor