sbcl

How to change SBCL's current directory?

a 夏天 提交于 2019-12-03 17:50:03
问题 It is very easy to change CLisp's current working directory: >cat ~/.clisprc.lisp ;;; The following lines added by ql:add-to-init-file: #-quicklisp (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init))) (cd "/media/E/www/qachina/db/doc/money") (load "money") However, it seems there is no cd similar function in SBCL. How can this be done with SBCL? 回答1: CL-USER> (sb-posix:chdir "/home/apugachev") 0 CL

(Emacs) Text is read only?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 09:13:06
问题 So I was working in emacs and the suddenly, the slime-repl sbcl says text is read only. Well that's great because now I can't type anything into it. How do I fix? 回答1: "Buffer is read-only" can be cured by C-x C-q but as Drew & phils said, "Text is read-only" is very different -- it means some part of the buffer has a read-only property. Try moving away from the read-only part, e.g., to the end of the buffer. Emacs Lisp Manual > elisp.info > Text > Text Properties > Special Properties Since

How to use quicklisp when CL program is invoked as a shell script?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 09:00:29
问题 I am currently have a small program in Common Lisp, which I want to run as a shell script. I am using the SBCL and perfectly fine with this so will prefer to stay on this platform. :) I am aware about the --script option and it works flawlessly except for (ql:quickload) form. My program uses the CL-FAD, which loads through ql:quickload (I think I should mention that it is package-loading function from quicklisp). When script runs up to evaluating the (ql:quickload :cl-fad) form, it breaks

How to properly save Common Lisp image using SBCL?

て烟熏妆下的殇ゞ 提交于 2019-12-03 07:58:25
If I want to create a Lisp-image of my program, how do I do it properly? Are there any prerequisites? And doesn't it play nicely with QUICKLISP? Right now, if I start SBCL (with just QUICKLISP pre-loaded) and save the image: (save-lisp-and-die "core") And then try to start SBCL again with this image sbcl --core core And then try to do: (ql:quickload :cl-yaclyaml) I get the following: To load "cl-yaclyaml": Load 1 ASDF system: cl-yaclyaml ; Loading "cl-yaclyaml" ....... debugger invoked on a SB-INT:EXTENSION-FAILURE in thread #<THREAD "main thread" RUNNING {100322C613}>: Don't know how to

How can I run SBCL code under a Unix-like operating system in a convenient way?

天涯浪子 提交于 2019-12-03 07:45:58
问题 (David James both wrote the question and an answer. I'll edit it to conform to Stackoverflow standards.) Using SBCL you can compile Lisp code to machine code. Like Java, .net, C++ and even C you will need the runtime. So there are two ways to compile Common Lisp code. First is to make huge binaries which is explained in SBCL documentation. No SBCL needed on target machine. The other way is a more flexible one, which is to create machine code in a fasl (FASt Load) format. The SBCL runtime is

A simple example of using the stepper in SBCL

被刻印的时光 ゝ 提交于 2019-12-03 07:18:44
问题 Going through the computation with the LispWorks stepper is rather intuitive, but I cant figure it out in SBCL. Can somebody please give me a step-by-step example of how to use the SBCL stepper in the REPL on some simple function? Thanks. 回答1: * (proclaim '(optimize (debug 3))) * (defun foo (a b) (* (+ a b) b)) FOO * (step (foo 1 2)) ; Evaluating call: ; (FOO 1 2) ; With arguments: ; 1 ; 2 1] step ; Evaluating call: ; (+ A B) ; With unknown arguments 0] step ; Evaluating call: ; (* (+ A B) B)

Lisp Community - Quality tutorials/resources

二次信任 提交于 2019-12-03 03:53:13
问题 As many other people interested in learning Lisp, I feel the resources available are not the best for beginners and eventually prevent many new people from learning it. Do you feel it could be created some sort of community, with a website, forum or something, that provides good (as in quality) resources/tutorials, for Lisp users, possibly translated to several idioms? That way beginners that don't have the necessary skills for writing tutorials could help translating them. Is it a bad idea

How to use packages installed by quicklisp?

江枫思渺然 提交于 2019-12-03 03:24:21
I've installed the CL-PNG package using quicklisp. (ql:quicklisp 'png) Now I want to define my own package which depends on the CL-PNG package. Like so: (defpackage :FOO (:use :CL :PNG) (:export :BAR)) When compiling it I get this error: The name "PNG" does not designate any package. [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR] It seems that I have to call (require :PNG) on the REPL before compiling my package. What do I have to do to make the CL-PNG package available for the compiler without manually call require on the REPL? UPDATE: I'm using SBCL. You confuse two separate notions: a

How to change SBCL's current directory?

限于喜欢 提交于 2019-12-03 03:03:19
It is very easy to change CLisp's current working directory: >cat ~/.clisprc.lisp ;;; The following lines added by ql:add-to-init-file: #-quicklisp (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init))) (cd "/media/E/www/qachina/db/doc/money") (load "money") However, it seems there is no cd similar function in SBCL. How can this be done with SBCL? CL-USER> (sb-posix:chdir "/home/apugachev") 0 CL-USER> (sb-posix:getcwd) "/home/apugachev" CL-USER> (sb-posix:chdir "/tmp/") 0 CL-USER> (sb-posix:getcwd) "

Compiling Common Lisp to an executable

♀尐吖头ヾ 提交于 2019-12-03 01:41:31
问题 I recently started learning Common Lisp using SBCL. How can I compile my Lisp programs into a Windows binary? 回答1: Making hello.exe: * (defun main () (print "hello")) MAIN * (sb-ext:save-lisp-and-die "hello.exe" :toplevel #'main :executable t) [undoing binding stack and other enclosing state... done] [saving current Lisp image into hello.exe: writing 3160 bytes from the read-only space at 0x22000000 writing 2592 bytes from the static space at 0x22100000 writing 30134272 bytes from the dynamic