freenode/#lisp - IRC Chatlog
Search
18:37:37
Josh_2
phoe: Thanks, I found burgled-batteries didn't know there was a version for python 3 :)
19:22:31
jackdaniel
not: upgrade uiop though? I've been told numerous times that uiop is independent library
19:48:14
sjl
Anyone involved with gitlab.common-list.net here? I created an account to try to send a PR to fix a bug in iterate, but I can't seem to fork the iterate repo to my own account. It says I've "reached my project limit" even though I have zero projects.
21:57:07
no-defun-allowed
It could go wrong if you try something like (let ((x ...)) (loop for x = x then ...)) since LOOP will set up another binding for X.
23:02:44
jeosol
is anyone using CL to develop rest API applications. I am quite comfortable using some web libs (hunchentoot, caveman, etc) but not an expert. Wondering if anyone has some rest API examples to share or their applications.
0:33:32
dlowe
jeosol: I just (setf (hunchentoot:content-type*) "application/json") and then return (json-encode-json-to-string `((:status . "ok") ...))
0:35:01
dlowe
The session handling on hunchentoot is kinda primitive and prone to hacking, though. Thinking about writing my own.
0:36:27
jeosol
Someone told me about django-rest, but I don't want to be using two languages, if CL can get me what I want.
1:52:35
Josh_2
I have https://imgur.com/ELuz2SF.png and https://imgur.com/8sPkVqG.png but when I try to call the following https://imgur.com/xzuHV0f.png I just get undefined function call, I thought if you :use a package in your own defpackage it pulls the symbols from that package into your new one
1:58:40
Josh_2
what am I missing with all this packaging stuff that means I can't call the functions from my the packages I :use?
2:01:23
aeth
Josh_2: you don't export 'write-pin you export '|write-pin| because you're using the symbol named "write-pin" not "WRITE-PIN". Things are upcased by default, not case-insensitive by default.
2:02:25
aeth
You can export "WRITE-PIN" and some people use it as a micro-optimization. This might be important if you're running it on a computer from the 1980s.
2:41:54
mister_m
When defining a macro, and using a let statement with a (gensym) invocation, is there a way I can provide a value to the let-binding in addition to having the macro expander generate a symbol for me? Or do I need to invoke (gensym) in one let binding, and then assign to the gen'd symbol in other using let*?
2:52:54
Xach
mister_m: i don't fully follow the question, but macros are just functions return source code, so you can use anything you like to form that returned code
3:00:49
mister_m
Xach right, but in a let binding i can provide a value (let ((thing "test")) ...) - can i provide a value if I also have to (gensym) the ``thing`` binding?
3:09:18
Xach
references to that symbol in other parts of the code only care about its identity, not its name or package
3:12:36
pjb
(let ((s1 (intern "FOO" #|in this package|#))) (unintern s1) (let ((s2 (intern "FOO" #|in this package|#))) (list (eq s1 s2) (symbol-name s1) (symbol-name s2) ))) #| --> (nil "FOO" "FOO") |#
5:59:28
mfiano
Is POSITION the idiomatic thing to use when checking for the presence of an element in a vector, when the vector can have nil elements and the element to be checked can also be nil?
6:01:26
mfiano
Ok. I'll just add a comment because I can see that confusing me at a later date (not using the integral return; this is simple for an ASSERT).
6:03:11
beach
The reader expects a Boolean value for IF and ASSERT, but POSITION does not return a Boolean value.
6:03:25
mfiano
Can you elaborate on the "don't do (assert (position ...)), or is that the PN/KP thing too?
6:04:25
aeth
beach: so would the correct behavior be to define a function that does (if (position ...) t nil) then?
6:05:13
mfiano
Is there a distinction in the spec that specifies that it cannot be a generalized boolean? Maybe I should just read this paper. Have a link, beach?
6:05:55
beach
mfiano: It has nothing to do with semantics. It has to do with the message that you send to the person reading your code.
6:06:22
beach
If we were only interested in semantics, there would be no problem with obfuscated code.
6:08:14
mfiano
Aha, ok. I was reading the title. That is the venue if I actually click through to one of them :)
6:15:21
mfiano
beach: So would you do (unless (null (position nil sequence)) t), (not (null (position nil sequence))), or other for ASSERT?
6:19:05
beach
Or more likely, I would signal an error, as in (when (null (position ...)) (error...))