Questions tagged [lisp]

Questions relating to editing code in Lisp-like languages (i.e., Common Lisp, Scheme and similar), and working with Lisp read-eval-print loops. Questions about specific languages should use the tag for that language (e.g., [common-lisp], [guile]). Note that Emacs's Lisp dialect is Emacs Lisp, with the tag [elisp]. Note: questions about editing Lisp in Emacs are on-topic, but general LIsp programming questions are not.

Filter by
Sorted by
Tagged with
1
vote
1answer
18 views

Validating Arguments to a Function

I would like to validate the argument to a function before its action is executed. The main concern is the passing of a void variable. How can I trap this? (defun is-it-bound(item) (if (boundp 'item)...
1
vote
0answers
55 views

What's the value in using a REPL for ELISP development? [closed]

What's the value in using a REPL? I've always wondered the advantages/disadvantages of using a REPL are (if there are any) as opposed to eval-print-last-sexp and then undoing the text printed (or ...
0
votes
1answer
80 views

Confused by what Paul Graham says about locality in his book "On Lisp" [closed]

https://sep.yimg.com/ty/cdn/paulgraham/onlisp.pdf On page 36 Paul writes the following: The conditions above do not guarantee the perfect locality you get with purely functional code, though they do ...
25
votes
3answers
12k views

When/why should I use progn?

I have seen progn being used quite a lot as I browse the configuration files of experienced Emacs users. I found this nice explanation of progn, but what I am really curious about is, what is the ...
1
vote
0answers
90 views

SLIME not starting properly on MacOS Emacs

Pretty new to Emacs && Lisp, trying to get started.... I'm trying to get SBCL working via SLIME in Emacs 27.1 (9.0). After following the instructions to add the MELPA repo to my .emacs and ...
1
vote
0answers
41 views

Autodocument function for C Code

Suppose i have this line of code presenting a C function prototype: int sum_Func(int a, int *b) I want an Emacs lisp function that adds the function description (initialization) according to its ...
2
votes
1answer
150 views

Adjusting indenting for lisp if statements

I am learning common lisp and am trying to follow the style guide suggested by lisp-lang.org. In this style guide is an if statement style that I think makes the code more readable: (if (cond) (...
1
vote
1answer
304 views

Find out, which mode is in use

Suppose I want to code something like this case mode in lisp-mode) do-something ;; shell-mode) do-other ;; latex-mode) do-different ;; esac What ...
6
votes
1answer
187 views

Shortening trees list with (setcdr (nthcdr 2 trees) nil)

I am starting to learn elisp and working through this tutorial https://www.gnu.org/software/emacs/manual/html_node/eintr/kill_002dnew-function.html and I do not understand this basic example: (setq ...
2
votes
1answer
482 views

how to specify an Cyclic list in lisp?

How to specify a list, which's last element is referring to the first element? By specify I mean, for example, how to write a setq statement with this list. I have seen this in the documentation, ...
1
vote
1answer
2k views

How to properly use emacs and slime to program in Common Lisp

I'm brand-spanking new to LISP. I'm trying to get started with it, and I installed Steel Bank Common Lisp as well as SLIME so I can program in emacs. As far as I know, Slime simply provides an ...
1
vote
1answer
274 views

How to pop an arbitrary element from a list?

Q: how do I pop an arbitrary element from a list? Given the list '(a b c d e), pop returns a and destructively modifies the list to '(b c d e). How can I generalize this function so I could pop an ...