Search
Monday, 1st of January 2018, 3:32:30 UTC
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
13:09:16
Xach
Shinmera: If I made a feed for build failures, should I lump them together?
13:09:25
Xach
I am doing some pattern-matching heuristics
13:09:47
Shinmera
I don't know if grouping things into a single feed per author is a good idea. Some people might individually care about failures of a particular project.
13:09:53
Shinmera
Unless you're going to offer both.
13:10:25
Shinmera
And no, I'm fine with subscribing to multiple feeds, so just doing per-github-account or something is fine by me.
13:10:41
Shinmera
No need to put them together.
13:11:20
Shinmera
And who knows, maybe some day I'll get lucky and someone else will finally contribute significantly to Shirakumo projects.
13:56:53
phoe
I have a list (A B C D E F ... P Q R ... X Y Z). Is there a function that will get me a subsequence of this list, starting from the beginning, and ending at Q?
13:57:08
phoe
Where Q can be any object.
13:57:59
phoe
Or should I just use SUBSEQ with POSITION?
13:58:02
beach
(subseq list 0 1+ (position 'Q list)))
13:59:37
Shinmera
(loop for c in list until (eq c thing) collect c)
14:00:31
Shinmera
move the until after the collect if you want the q
14:08:05
Xach
phoe: i have a weird variation
14:08:52
Xach
(ldiff list (cdr (member 'q list)))
14:09:20
Xach
i don't see ldiff used a lot.
14:09:21
_death
I was just about to say.. but why CDR?
14:09:37
beach
So that Q is in the result?
14:10:06
Xach
if you want Q as the final object.
14:10:08
_death
right, guess I expected a closed interval
14:10:46
Xach
hi sabrac. thanks for making your library comparison pages. they are great.
14:12:06
sabrac
Thank you. I wish I had more time to work on them because I learn so much doing them.
14:12:45
sabrac
Is there anything in particular I should prioritize?
14:13:14
pagnol
I sometimes see keywords prefixed with a #, like #:abc, what are those?
14:13:20
Shinmera
sabrac: I remember you mailing me about one some months back, but I don't recall it ever getting released
14:13:26
Shinmera
I forgot what it was about though :(
14:13:55
_death
pagnol: these aren't keywords, but uninterned symbols
14:14:53
_death
pagnol: you should tokenize them in your mind as #: abc rather than # :abc..
14:16:38
specbot
http://www.lispworks.com/reference/HyperSpec/Body/02_dhe.htm
14:17:36
phoe
Xach: ldiff! that was the function I was thinking of.
14:17:48
sabrac
Shinmera: I have one half completed on test frameworks. Work got in the way.
14:19:18
pagnol
apparently people use dots in package names to achieve something like nested namespaces, I'm wondering if I should adopt that
14:19:19
specbot
http://www.lispworks.com/reference/HyperSpec/Body/f_ldiffc.htm
14:21:28
Xach
pagnol: It's syntactic only
14:21:33
Xach
pagnol: I don't prarticularly like it.
14:21:40
Xach
Slashes are even uglier to me.
14:22:41
_death
with package-inferred-systems slashes have semantics
14:24:13
_death
also slime will display only the part after the last dot in the repl
14:30:30
pagnol
Xach, is there anything else you use to imitate nested namespaces?
14:30:57
beach
pagnol: Hierarchies are not necessarily good.
14:31:11
beach
Perhaps it is time to use package-local nicknames.
14:32:07
beach
pagnol: That way, you can use long names for your packages and short ones to refer to them.
14:33:33
Xach
pagnol: for related packages, i use a short or abbreviated prefix and a hyphen.
14:35:19
Xach
Some systems use one big package and lump everything into it. I don't like that style a lot - I want the comfort of knowing I won't affect unrelated things in a particular section of a larger project.
14:35:58
Shinmera
I use both the FQDN style and the basic hyphen style.
14:36:58
Shinmera
Fully Qualified Domain Name
14:37:29
sabrac
_death: Thank you for the reminder on package-inferred systems. I had forgotten about that. Heads off to re-read the asdf documentation.
14:39:13
Shinmera
sabrac: By the way, thanks again for the feedback and bug reports that spawned from the previous articles you wrote :)
14:46:06
sabrac
Shinmera: Thank you for actually documenting things.
14:46:14
KZiemian
AreoNoxi: have you still some question about CLUS
14:46:38
KZiemian
AreoNoxi: maybe today I can give you some clues
14:46:57
Shinmera
KZiemian: You're typing the name wrong
14:47:42
KZiemian
Shinmera: oh, yes you are right
14:50:26
KZiemian
AeroNotix: maybe today I can give more things about CLUS
14:54:53
KZiemian
will we celabreat in some way 60 years of Lisp?
14:55:17
KZiemian
my celebration: write 10 real program in CL
14:55:31
KZiemian
maybe give a look o Scheme
15:29:36
pagnol
I got the impression there's quite a high reliance on global variables in lisp libraries
15:30:57
shka
pagnol: special variables with global scope
Monday, 1st of January 2018, 15:32:30 UTC