My Technical Notes

Wednesday, 16 March 2016

Elisp: Executing two Statements in a Sequence

Description of progn

In C#, statements are delimited by `;`, the semi-colon, however there is a special statement in Elisp, `progn`, that can be used to sequence two or more statements.

If we execute `describe-function 'progn`, then it will give use the following description:

progn is a special form in 'C source code'.

(progn BODY...)

Eval BODY forms sequentially and return value of last one.

Example of progn use

(progn (print "hello") (print "world"))
will print "hello" and "world" on separate lines.

No comments: