freenode/#lisp - IRC Chatlog
Search
13:30:38
scymtym
SBCL has SB-INT:ENCAPSULATE which is like a rudimentary advice facility, but it is internal
13:55:32
dlowe
If they were better specified, I imagine they would have been less portable between OSes
13:56:25
jackdaniel
if anyone things about grand new CDR they should write a precise pathnames and logical pathanmes along with an elaborate test suite for this addendum
14:36:05
mfiano
Any HTTP experts here? I've been trying to solve a problem in my use of drakma for 2 days. I would like to POST an HTTP array with a content type of application/x-www-form-urlencoded, in the same way the curl argument -d works. This command: "curl https://... -d -d items[0][plan]=plan_FPjya2CCLvYKVB" does the correct thing, but drakma expects an association list for content to post, and sending that in any
14:36:08
mfiano
variation results in the server receiving it wrapped in a string and the server returns that it is not an array.
14:42:23
jackdaniel
mfiano: afair drakma has keyword arguments like external-format and force-binary, maybe this will help?
14:43:19
mfiano
jackdaniel: Hmm, I could try that, but I have to POST other arguments with it that *should* be strings
14:43:33
mfiano
Also not quite sure what to specify for those to get the behavior of the above curl argument
14:51:55
Xach
mfiano: there is no such thing as an http array! what you are sending via curl is a parameter named "items[0][plan]".
14:52:59
mfiano
Xach: Indeed. This is how the API service receives the items: https://files.michaelfiano.com/images/screenshots/img-20190711105208.png
14:55:08
mfiano
It's actually expecting data as i posted by a form. The content type cannot be application/json
14:57:24
mfiano
Well that is something I didn't try. I'll play around with that after lunch. Thanks for your help!
14:57:59
Xach
mfiano: i base this suggestion on my understanding of forms from long ago. many language environments choose to interpret keys as describing structure, but to http, they are just strings
15:00:18
mfiano
As far as the value part of the alist, I'm still thinking of a good solution to convert lisp types to strings. like T -> "true", but done so in a way to work with aggregate types recursively
16:01:41
Xach
Hmm, if you're creating a list of command-line arguments to call a shell command, and some of them might be optional key/value pairs (e.g. --worker-count 42) and some of them might be flags (e.g. --no-scrubs), and you have to inspect some stuff to decide what to include - would you use `(... ,@(unless scrubsp ,@(list "--no-scrubs")) ...) or something else?
16:02:21
Xach
(mapcan #'identity (list (list "--worker-count" worker-count) (unless scrubsp (list "--no-scrubs")) ...))))?
16:32:02
sjl_
Xach: (append `("--worker-count" ,worker-count) (unless scrubs? '("--no-scrubs"))) maybe?
16:39:15
pfdietz
,@(when <pred> (list <value>)) is the idiom I use for optional inclusion of something in a list I'm constructing.
16:56:51
_death
Xach: not long ago I started on some project calling programs like that.. an example of what I came up with at the time: https://gist.github.com/death/9b2ee7cc0196bdf45427cca425631516
16:58:25
Oladon_work
Question for you all — how many of you are open to (and/or have engaged in) CL contracting, and if so what's your typical rate?
17:03:01
shka_
Xach: i have something that is almost cl list in concept, but must be terminated properly
17:03:08
_death
Xach: yes.. also prin1-to-string numbers.. it's recently developed, so can likely be further improved
17:03:14
aeth
Oladon_work: That question might be better for a forum because the few who contract might not see it on IRC
17:42:25
Oladon_work
aeth: Yeah, just getting a feel for now — and I know you guys a bit better than any of the fora
17:53:15
asdf_asdf_asdf
Hi. How on the Spoj.com my answer is incorrect, because Non-Zero Exit Code (NZEC)?
18:01:47
asdf_asdf_asdf
(setf explode1 (explode-3 (nth 0 (multiple-value-bind (a b) (read-line *standard-input*) (list a b)))))
18:05:46
pjb
asdf_asdf_asdf: perhaps it crashes before that exit? Try to issue a message just before it?
18:06:33
pjb
asdf_asdf_asdf: it's equivalent to (setf explode1 (explode-3 (read-line *standard-input*))) so…
18:06:44
asdf_asdf_asdf
@pjb, script not crashes. Return Non-Zero Exit Code, compiling without errors/warnings.
18:12:29
Bike
we're not going to be able to understand anything if we don't even know what's happening, you know?
18:13:19
asdf_asdf_asdf
Bike, it is not valid, because all program compiled without errors/warnings, but in [u]the spoj.com[/u] return non-zero exit code.
18:16:24
Bike
asdf_asdf_asdf: it would be very unusual for sbcl to _run_ without printing errors or warnings and then exit as such. it seems more likely that whatever website that is is suppressing output.
18:20:58
asdf_asdf_asdf
@Bike, yes. I test it on the local machine. On spoj.com I send solution, but wrong.
18:23:51
asdf_asdf_asdf
Bike, I know probably, why not works. In spoj.com compiler is another version than I am in local machine. Thanks.
18:26:15
asdf_asdf_asdf
pjb, but how compile it aggressive optimization? Which option in SBCL? I have zero errors/warnings.
18:27:02
Bike
sbcl already signals all the compiler warnings it can. i don't think there's any way to make it stricter than it already is.
18:27:15
Bike
the problem is probably something stupid like the website not giving sbcl enough memoryl
19:08:53
manualcrank
your program prolly returns a nonzero exit code because it encountered an exception
19:14:20
manualcrank
unless you run it on the same test data as spoj (not possible; this data is not available), you can't say it works correctly at home
19:39:54
manualcrank
can't read polish. Also, it's a hidden problem. A hidden problem is a waste of time. It means an admin decided "it has incorrect language version or invalid test data, or description of the problem is not clear."