common-lisp Questions
3
Solved
Lisp is said to enable redefinitions of its core functions.
I want to define an alias to the function cl:documentation function, such that
(doc 'write 'function) === (documentation 'write 'functi...
Hardner asked 16/6, 2014 at 21:29
2
Solved
I want to do some integer arithmetic and was checking if SBCL could gain more speed if I provide explicit information about the type of values I use. While I easily could use declare in a defun or ...
Constable asked 21/3, 2017 at 21:1
2
How many memory the bit-vector using in sbcl?
Does per bit spend 1 bit memory?
Does per bit spend 1 byte memory?
Does per bit spend 1 word memory?
Affiche asked 4/3, 2017 at 8:53
2
Solved
I'd like to learn more about lisp macros and I want to create a simple implementation of the defun macro.
I'm also interested in lisp's source code in all the implementations.
Austerlitz asked 26/2, 2017 at 16:17
3
Solved
I have recently been working with hash tables in Common Lisp. I have been wondering how to make a separate copy of a hash table containing all the same values as the first. Is there an official way...
Torsk asked 25/9, 2014 at 18:19
5
Solved
I'm new to CL and am using AllegroCL. I'm trying to figure out how to organize my source code to meet the following requirements:
I want to prevent the src code from including my test suites.
I w...
Norford asked 15/8, 2012 at 15:1
1
Solved
What is the fundamental difference in the functions defined using defun and setf as below and is one method preferred over another outside of style considerations?
Using defun:
* (defun myfirst (...
Review asked 5/2, 2017 at 20:47
1
This is a Common Lisp data representation question.
What is a good way to represent grammars? By "good" I mean a representation that is simple, easy to understand, and I can operate on the represe...
Putrescine asked 23/3, 2016 at 22:1
2
Solved
I have a string that contains an escaped URL:
http%3A%2F%2Fexample.com%3Ffoo%3Dbar+baz
I'm trying to decode it to the following:
http://example.com?foo=bar+baz
However, I can't find any suita...
Evanesce asked 2/7, 2012 at 11:48
3
common lisp and clojure do
(defn function-name (arg1 arg2) (body))
racket/scheme does
(defn (function-name arg1 arg2) (body))
The latter makes more sense to me because the syntax for function...
Hypotension asked 21/1, 2017 at 0:19
5
Solved
How can I exchange two variables in LISP without using a third variable?
Selwin asked 9/2, 2009 at 22:10
3
Solved
How do you bind multiple values returned from a function, inside a do loop?
The following is obviously very wrong, but is something like this possible?
(do (((x y z) (3-val-fn) (3-val-fn)))
((equ...
Condolent asked 13/1, 2017 at 6:10
3
Solved
I am learning to structure my CL programm and now having trouble to use the CLOS while programming in the large with packages.
package.lisp
(defpackage :my-project.a
(:use :cl)
(:export
creat...
Disinfectant asked 10/1, 2017 at 17:50
1
Solved
One of my threads entered the debugger. I want to switch to it, expect that stacktrace, choose a restart, etc... How can I do that?
I am using bordeaux-threads.
Cementum asked 6/1, 2017 at 9:46
2
Solved
I'm learning Common Lisp from Practical Common Lisp. It has an example of helper functions for reading and writing binary files in Chapter 24. Here's one example:
(defun read-u2 (in)
(+ (* (read-...
Eject asked 1/1, 2017 at 11:0
2
Solved
According to http://www.phyast.pitt.edu/~micheles/scheme/scheme29.html
"It is worth mentioning that if you use a package system (like in Common Lisp) or a namespace system (like in Clojure) in pra...
Klingensmith asked 25/12, 2016 at 13:9
2
Given this example code (from a Reddit /r/lisp question):
(defun next (pos)
(nth (1+ pos)
'(0 1 2 3 4 5 6 7 8 9 10)))
(defvar *next* (function next))
(let ((old-next #'next)
(previous (make-h...
Lousy asked 26/12, 2016 at 10:50
3
Solved
I stumbled upon this article explaining the Y Combinator. The code is in Scheme, but I'm trying to work through it using Common Lisp.
However, I'm having trouble doing the translation from Scheme ...
Saldivar asked 5/12, 2016 at 23:35
4
Solved
I will get an undefined function warning about f2 in SBCL with following code sample.
Is it possible that I can declare f2 first, like in C, to avoid the warning.
I Googled, without any clue.
(de...
Emileeemili asked 28/11, 2016 at 4:3
1
Solved
I am trying to implement a basic nested loop in CL, but the Loop macro is resisting this. Basically, I would like to find all possible products of 3-digit numbers and accumulate them into a list.
...
Phonics asked 25/11, 2016 at 20:45
4
Solved
What's the lisp equivalent of a pip requirement file, ruby gemfile, node package.json, etc? I'm not entirely sure how asdf and quicklisp relate if those are the proper things to use.
Farber asked 31/10, 2013 at 22:56
1
Solved
I have a class like this one
(defclass shape ()
((color :initform :black)
(thickness :initform 1)
(filledp :initform nil)
(window :initform nil)))
Is there a function in common-lisp how to g...
Lake asked 22/11, 2016 at 12:36
3
Solved
I've noticed in Scheme, Racket, and Clojure that the expression (using Clojure here) (and true '()) evaluates to (), and (and '() true) evaluates to true. This is true not only for the empty list, ...
Eccentricity asked 17/11, 2016 at 17:8
2
Solved
I'm somewhat new to CL and currently trying to wrap my head around mapcan, #', funcall and closures.
Here is a closure, which applies a predicate to a number n and, if correct, returns (list n), el...
Hebrews asked 10/11, 2016 at 21:32
3
Solved
I am trying to learn lisp and I have some difficulties with prime numbers. I need a function is-prime and if it is prime I have to return t and if it is not I have to return nil.
(prime 41) =>...
Masturbate asked 15/12, 2013 at 22:16
© 2022 - 2024 — McMap. All rights reserved.