freenode/#lisp - IRC Chatlog
Search
21:56:09
moldybits
hm, slime keeps crashing for when i try to set-pprint-dispatch 'integer to whatever, while 'float works fine.
21:58:35
moldybits
*print-base* and *print-radix* will have to do for now. thanks, jasom and LdBeth!
22:03:40
moldybits
does this seem like a reasonable thing to do? (take-bits 3 #b10101111) => #b101 and (discard-bits 3 #b10101111) => #b1111
22:05:42
emaczen
Do we have to use eval-when for reader macros in a file? Or is there a way to make it implicit?
22:10:20
jasom
something like: (defun take-bits (n x &optional (byte-size *byte-size)) (ldb (byte (- byte-size n) 0) x))
22:13:13
jasom
with typo correction, seems to work: (defun take-bits (n x &optional (byte-size *byte-size*)) (ldb (byte (- byte-size n) 0) x))
22:17:32
moldybits
yes, that is much simpler than my original implementation. not sure if it's worth naming, then ...
22:17:34
jasom
though if you want it to be fast; I suggest using a constant named +byte-size+ rather than a variable named *byte-size*
22:19:10
jasom
ldb is one of those things that is implemented many times (often poorly) as a preprocessor macro in C, so it's nice to have it in the lisp spec.
22:27:13
moldybits
i'm translating some C into Lisp in order to understand and refactor it. later i might translate it back into C.
1:56:53
Ukari
(defparameter th (bt:make-thread (lambda () (sleep 5) (print "runs")))) (bt:interrupt-thread th (lambda nil)), why i can't interrupt the thread from sleep?
2:07:39
Ukari
(defparameter th (bt:make-thread (lambda () (catch 'wake (sleep 5)) (print "runs")))) (bt:interrupt-thread th (lambda () (throw 'wake nil)))
2:12:54
White_Flame
an interrupt is just pause, run externally-provided lambda, resume. If you want to wake up from a timeout, you should use locks/waits/etc with timeouts
3:05:37
fiddlerwoaroof
minion: memo for emaczen: I've looked into Obj-C exceptions, but I don't think there's anything you can really do about them
3:06:07
fiddlerwoaroof
minion: memor for emaczen: see the recent-ish comments in #ccl from eschatologist
3:06:11
fiddlerwoaroof
minion: memo for emaczen: see the recent-ish comments in #ccl from eschatologist
4:34:19
Ukari
is there a test framework which could run assert asynchronously? like (test test-foo (bt:make-thread (lambda () (is (eq 1 1)))))
4:36:47
Ukari
because some of my test will run in another thread, and if the test framework support assert asyncly it will be more easy to write tests
4:41:40
pjb
Ukari: you see now why my stance on tests is that everyone should write their own test framework, instead of trying to use an existing one?
4:42:12
pjb
Ukari: the requirements on a test framework depend strongly on the kind of system you want to test.
4:42:49
pjb
Ukari: you could take an existing test framework, and add the required features to be able to run them in parallel in different threads.
4:44:23
pjb
I would suggest com.informatimago.common-lisp.cesarum.simple-test, which is simple, and you may be able to extend easily to support threads. ;-) patches welcome.
4:46:05
pillton
Ukari: There are other ways to solve this problem which don't require a new test framework.
7:35:50
didi
How do I break out of a recursive function without going through all the recursions? I wrote something like <https://paste.debian.net/hidden/430c13d2>. Is it too gross? I thought of using signals, but it sounded like too much. It looks like a continuation, but I have control of the scope, that is, I'm using the lexical scope.
7:37:13
no-defun-allowed
Safari asks me what client certificate to use, and the server will not accept them.
7:38:47
no-defun-allowed
Though, it'd probably be too complex for a FLET, and I'd move it into a DEFUN.
7:39:29
didi
no-defun-allowed: Yeah, mine is growing beyond a screen page, so I think I should break it.
8:59:46
schweers
when sbcl claims to have no more memory ... is there something I can do in that image to investigate? i.e. find out where all the memory went?
9:32:26
schweers
I’ve now got it running in SLIME, I’ll see what I can do when that point comes again. I guess it won’t be for another few hours though. So thanks for your tips, espectially about ROOM. I had completetly forgotten it.