2022 Developer Survey is open! Take survey.

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
1 answer
59 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)...
user avatar
1 vote
0 answers
62 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 ...
user avatar
0 votes
1 answer
84 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 ...
user avatar
1 vote
0 answers
109 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 ...
user avatar
1 vote
0 answers
42 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 ...
user avatar
2 votes
1 answer
214 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) (...
user avatar
  • 123
1 vote
1 answer
322 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 ...
user avatar
  • 343
6 votes
1 answer
196 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 ...
user avatar
  • 1,333
1 vote
1 answer
3k 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 ...
user avatar
1 vote
1 answer
294 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 ...
user avatar
  • 31k
2 votes
1 answer
520 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, ...
user avatar
  • 4,211
26 votes
3 answers
13k 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 ...
user avatar
  • 4,535