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
0 votes
3 answers

Is there a code example demonstrating a meaningful usage of the built-in function `funcall`?

In order to understand what the symbol funcall means I have checked out its documentation. If I understand it right after reading the docs this symbol represents a function which in my eyes can be ...
Claudio's user avatar
  • 420
1 vote
1 answer

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)...
naugiedoggie's user avatar
1 vote
0 answers

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 ...
John DeBord's user avatar
0 votes
1 answer

Confused by what Paul Graham says about locality in his book "On Lisp" [closed] 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 ...
John DeBord's user avatar
1 vote
0 answers

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 ...
wr0ngway's user avatar
1 vote
0 answers

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 ...
Ghost_tn's user avatar
2 votes
1 answer

Adjusting indenting for lisp if statements

I am learning common lisp and am trying to follow the style guide suggested by In this style guide is an if statement style that I think makes the code more readable: (if (cond) (...
CL40's user avatar
  • 123
1 vote
1 answer

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 ...
Jan's user avatar
  • 373
6 votes
1 answer

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

I am starting to learn elisp and working through this tutorial and I do not understand this basic example: (setq ...
wolfv's user avatar
  • 1,383
1 vote
1 answer

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 ...
middleman3's user avatar
1 vote
1 answer

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 ...
Dan's user avatar
  • 32.7k
2 votes
1 answer

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, ...
jue's user avatar
  • 4,486
29 votes
3 answers

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 ...
elethan's user avatar
  • 4,755