Search
Monday, 1st of January 2018, 1:09:07 UTC
1:09:51
aeth
You can use something like Quickproject. https://www.xach.com/lisp/quickproject/
1:10:36
aeth
Or you can set things up once and basically just copy your old project foo.asd file to use for new bar.asd file when you want to make bar instead of foo
1:12:24
aeth
If you set things up on your own, you probably want to create a link in ~/quicklisp/local-projects/ (or wherever your local-projects directory is) to wherever your project is so Quicklisp can find it as if it was in Quicklisp, e.g. like this: cd ~/quicklisp/local-projects/; ln -s ~/git/foo
1:12:40
aeth
If you use Quickproject, it automatically registers the system so ASDF and Quicklisp can find it iirc.
5:00:24
beach
Good morning everyone!
5:01:04
beach
And a happy new year 2018.
5:12:49
wxie
(macroexpand-1 (with-gensyms (result)
5:12:49
wxie
(format t "~a ~%" ,result))))
5:13:29
wxie
why do I get an error: LET: variable RESULT has no value?
5:14:06
beach
Maybe because you didn't quote the form that you submitted to macroexpand-1?
5:16:33
wxie
It becomes: (LET NIL ...)?
5:17:23
Bike
(let () ...)? that's ok
5:17:31
wxie
This causes that result is not bound.
5:17:39
Bike
no, something in the ... does
5:17:56
beach
Well, I don't know where you got your with-gensyms from.
5:18:00
wxie
(LET NIL `(LET ((,RESULT T)) (FORMAT T "~a ~%" ,RESULT)))
5:18:36
Bike
that's from what, (macroexpand-1 (with-gensyms ...))? or (macroexpand-1 '(with-gensyms ...))?
5:19:00
wxie
The second (with quote).
5:20:04
Bike
your with-gensyms is messed up, i guess
5:20:20
Bike
with alexandria's, i get (let ((result (gensym "RESULT"))) ...)
5:20:51
krwq
wxie: use quote before expression in macroexpand
5:30:26
wxie
(defmacro with-gensyms ((&rest names) &body body)
5:30:26
wxie
`(let ,(loop for n in names collect `(,n (gensym)))
5:34:27
Bike
if i use that with-gensyms i don't get any let nil.
5:34:38
Bike
are you sure that that is the definition in force?
5:36:17
krwq
i find using literals inside the loop problematic - try using `(list ,n (gensym))
5:36:49
Bike
you mean (list n '(gensym))
5:40:04
wxie
I do not need rewrite the with-gensyms anyway. The problem remains.
5:40:24
Bike
i can't reproduce. your definition works fine here.
5:41:44
krwq
what does (symbol-package 'loop) and *package* return?
5:42:25
wxie
#<PACKAGE COMMON-LISP>
5:43:15
krwq
what about (with-gensyms (foo) foo)?
5:47:30
wxie
- LET: variable FOO has no value
5:48:01
krwq
ok, did you use alexandria?
5:48:13
krwq
(ql:quickload :alexandria) (use-package :alexandria)
5:48:16
Bike
they pasted the definition right there
5:48:28
krwq
take-new when it asks to override with-genyms
5:49:08
Bike
or just run your defmacro again. the point is whatever macro you have bound to with-gensyms ain't that one
5:49:48
krwq
but i guess only in source code
5:52:55
wxie
Ok, it works with alwxandria. Thanks. Is that standard Common Lisp?
5:53:11
pjb
(ql:quickload :alexandria)
5:53:17
krwq
wxie: it is one of the most popular libs though
5:53:41
Bike
i mean, the library is written in standard cl
5:53:41
wxie
It overrides several CL functions.
5:53:52
Bike
alexandria? no it does not.
5:54:33
wxie
I was asked to take a few.
5:55:10
Bike
your image is in a strange state.
5:58:33
wxie
It's clisp-2.49, and very stable so far.
6:00:15
Bike
no, i mean you did some definingn or undefining or package imports or something.
6:00:24
Bike
if you start a fresh clisp and load alexandria there should be no conflicts.
6:07:52
krwq
wxie - when you use symbol in your image which doesn't exist it will be interned - after you use alexandria and add the symbol which didn't exist before it will see conflict because you already have it
6:08:26
krwq
so the symbol is interned but it is not bound to any function to variable
6:08:45
wxie
Thanks for helping. Glad that it is solved.
6:54:25
shrdlu68
Good morning, fellow earthlings!
7:07:09
shrdlu68
What's the way to wait till a thread exits in bordeaux-threads? The docs advise against #'join-thread
7:09:07
shrdlu68
Hmm, I could use condition variables...
8:56:13
shrdlu68
This function counts from 0 past 7 and errors. However, changing "*standard-output*" to "t" in line 8 changes that. How is this happening? https://paste.pound-python.org/show/kNpHapRGwKjykU7YFXSX/
8:58:04
shrdlu68
i.e if I change *standard-output* to t it runs perfectly and counts only from 0 to 7 as it should.
9:02:21
whoman
hm, try to flush stdio ?
9:03:00
whoman
or .. https://stackoverflow.com/questions/27178642/sbcl-multiple-threads-write-to-standard-output ?
9:04:42
shrdlu68
Further investigation shows that it happens either way, just not predictably.
9:05:48
shrdlu68
Even without printing, why would it count past 7?
9:09:15
beach
It is not specified whether the final value of a loop counter is the last value you specified or one greater.
9:09:27
beach
I believe in SBCL it is one greater.
9:09:51
beach
Or, maybe it's specified to be wrong. I forget
9:09:59
beach
SICL LOOP doesn't have this problem, of course. :)
9:13:30
shrdlu68
But (loop for i from 0 to 7 collecting i) always results in '(0 1 2 3 4 5 6 7) in SBCL under normal circumstances.
9:13:59
Shinmera
shrdlu68: The problem is that the thread might start after the loop has finished.
9:15:13
Shinmera
If you want to avoid this you need to create a new binding for the index around each thread creation.
9:16:19
shrdlu68
I see. I'm currently creating a new binding _inside_ each thread.
12:09:19
phoe
How can I tell DRAKMA to error if it encounters a response code like 4xx or 5xx?
12:16:02
JuanDaugherty
it will have already done, you just need to hook, it's your job
12:16:29
JuanDaugherty
because programmer
12:20:37
Xach
phoe: I generally wrap raw drakma to do things like that when working with apis.
12:21:20
Xach
I'll glom all the separate bits into a single response object, then specialize that object, then have a gf that finds an error condition for that object based on all its parts (response code, headers, body)
12:21:47
Xach
For some APIs 4xx isn't an error, for example.
12:51:01
Shinmera
if I remember correctly dexador errors on non-200 codes.
12:53:29
phoe
Shinmera: dexador "is still BETA quality. The APIs will be likely to change."
12:53:33
phoe
but I'm nitpicking now. (:
12:53:55
Shinmera
Sure, I can't recommend it myself either as I've had it fail on some sites.
12:54:03
Shinmera
It is much faster than drakma when it works
12:54:17
Shinmera
Which can be important
13:06:16
Xach
What's the difference between Shinmera and Shirakumo?
13:07:42
Shinmera
There's other people in shirakumo. http://shirakumo.org/
13:07:57
Shinmera
But it's still 99.9% me, so
Monday, 1st of January 2018, 13:09:07 UTC