freenode/#lisp - IRC Chatlog
Search
2:49:21
phf
does anybody have slime/swank backport to emacs 21, or have last favorite version that works with it?
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.