freenode/lisp - IRC Chatlog
Search
5:37:21
anticrisis
is there a handy function that lets you assign your own nickname to a package you import or use?
5:45:13
pillton
SBCL and ECL support package-local nicknames though. http://www.sbcl.org/manual/#Package_002dLocal-Nicknames
5:48:02
anticrisis
do other implementations ignore defpackage clauses they don't recognize or do you have to put a #+(or sbcl...) thing in front?
5:57:33
anticrisis
Interesting, "Logging in has been restricted to pre-existing users to prevent abuse."
6:38:10
drmeister
Are there any good libraries for doing substitutions in strings? Say (string-replace "{foo} something {bar}" '(("{foo}" . "replace-foo") ("{bar}" . "replace-bar")))
6:49:59
drmeister
I recall there was something in cl21 that did that - but people didn't like it as a general way of working with formatted output.
7:04:56
jackdaniel
drmeister: for a slighlty different approach for formattted output, you may read http://www.cs.yale.edu/homes/dvm/format-stinks.html which has simple `out' macro defined
9:04:50
shrdlu68
Are there any routines (libraries/implentation-specific) for printing floats in base 2?
9:11:18
pjb
loke: it's somewhat bad to use progn for do body, since by default it's actually a tagbody.
9:11:28
shrdlu68
Uh-I'm trying to implement arithmetic compression, and all the books and papers seem to have a way of representing floats in some format I don
9:12:07
pjb
(do ((i 0 (1+ i))) ((>= i 10)) (if (oddp i) (go :continue)) (print i) :continue) ; prints even numbers.
9:13:42
shrdlu68
It's from this paper: https://www.cc.gatech.edu/~jarek/courses/7491/Arithmetic2.pdf
9:16:34
pjb
Something like: (let ((f pi)) (multiple-value-bind (man exp sig) (integer-decode-float f) (format t "~:[-~;+~]0.~V,'0Be~B" (plusp sig) (float-precision f) man exp)) (values)) #| +0.11001001000011111101101010100010001000010110100011000e-110011 |# I'd guess.
9:19:54
pjb
More correctly: (let ((f pi)) (multiple-value-bind (man exp sig) (integer-decode-float f) (format t "~:[-~;+~]0.~V,V,'0Re~VR" (plusp sig) (float-radix f) (float-precision f) man (float-radix f) (+ (float-precision f) exp))) (values)) #| +0.11001001000011111101101010100010001000010110100011000e10 |#
9:26:41
pjb
Try: (loop for type in '(short-float single-float double-float long-float) do (write-line (float-internal-representation (coerce pi type)))) ; in your implementation ;-)
9:31:16
shrdlu68
Ah, hadn't opened it, thought it was the same thing as what you had written earlier, only formatted. My bad.
12:05:41
knobo
Just thinking.... I would change this: do (loop while (< (freq-m (aref a j)) (* 1.0d0 i)) do (incf j)) in to something like this: do (setf j (position-if (lambda (x) (< x (coerce i 'double-float))) a :start j :key #'freq-m))
12:06:35
zaoqi
How can I implement microKanren with fair conjunction? (conde (+o x y z) (== z 0)) => (conde (== z 0) (+o x y z))
12:10:48
Bike
zaoqi: you can keep asking that every day but with no context or specific questions none of us are going to know what you're talking about
12:10:48
Colleen
Bike: drmeister said 5 hours, 54 minutes ago: I fixed the most obvious problems with fastgf - it's back online as well as it ever was. I haven't incorporated it fully because there are metastability issues that I haven't fully solved. Maybe we can do that together. Can you pull the latest dev and start building it?
13:25:07
jackdaniel
if you want book which works with code from the very beginning (i.e doesn't teach how to program in general) go after pcl
13:25:13
minion
butterthebuddha: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
13:33:12
edgar-rft
butterthebuddha: The first two chapters in the Touretzky are for people who *never ever* worked with any programming language before. Touretzky mainly explains the language basics in really every detail. "Practical Common Lisp" explains everything with real-world code eamples, but assumes that you have at least a basic knowlege how computer programming works.
13:46:34
monsieur_h
Hello there, I'm a programmer and I'm intersted in learning LISP out of curiosity. Can you guys point me towards an up-to-date and efficient tutorial ?
14:37:33
thetabit
In slime, is there a way to reload a variable that has been defined as defconstant without a warning?
14:41:09
schweers
otherwise just put a restart around your definition if you don’t care about the warning
14:49:49
butterthebuddha
"(defun add-record (cd) (push cd *db*))" <- getting a *db* not defined error on that function
15:05:07
butterthebuddha
Also, is there a recommended common lisp implementation? Rn I'm using GNU Clisp
15:06:43
butterthebuddha
I just went with the GNU implementation because I didn't know which one to go with
15:08:44
random-nick
SBCL needs an existing implementation of CL as well as a C implementation for the runtime, right?
15:09:37
jackdaniel
random-nick: only for boostrapping it needs CL implementation and C implementation
15:10:04
jackdaniel
"random-nick: only for boostrapping it needs CL implementation and C implementation" ← I'm talking about sbcl, it doesn't need them for runtime
15:11:26
dlowe
once a language has been bootstrapped, I'm not sure its bootstrappability is really an issue
15:12:45
random-nick
dlowe: well, you need to bootstrap it again when porting it to a new architecture
15:13:35
jackdaniel
random-nick: for practical purposes SBCL has problem solved, because clisp is ported to that architecture (hence it may be used) and C is ported as well
15:13:53
dlowe
random-nick: you emit object code for the new architecture on a supported architecture