freenode/#lisp - IRC Chatlog
Search
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."