freenode/#lisp - IRC Chatlog
Search
10:59:57
ogamita
splittist: Ah right! ~{~} is like ~? (format nil "~{~}" "~A" '(42 33 b)) #| --> "4233b" |#
11:01:12
ogamita
all predicates are allowed to return "useful" values. Only digit-char-p is specified to do so, IIRC.
11:05:07
jackdaniel
so in conforming CL code you may depend only on digit-char-p returning something useful
11:14:01
ogamita
and mismatch, etc. So, I was wrong: there are more than one predicate specified to return useful values.
11:36:03
pfdietz
Those predicates were so annoying when writing ansi-tests. Had to wrap (not (not ...)) around many forms to convert true to T.
11:48:45
pfdietz
There are also cases where predicates returned different values depending on compilation. (typep x '(member x y z)) might return T if constant folded, or (X Y Z) if actually called with those arguments.
14:46:53
neirac
I just found out about time function in common lisp to measure execution time, made my day
14:47:46
jackdaniel
neirac: then this tool will make your whole week: https://github.com/scymtym/clim.flamegraph/blob/future/screenshots/screenshot-1.png ;-)
14:50:42
hjudt
hi! i am having a problem with the dbd-oracle library available from quicklisp. apparently, it is not thread-safe and causes sbcl to crash or report freaky memory corruptions. when using the same code with sqlite3 the problem goes away. does anyone know of alternatives?
14:56:23
pfdietz
How does dbd-oracle do with other lisps? If it works in, say, ccl, is that a sign of an sbcl bug?
14:58:27
p_l
https://github.com/sergadin/dbd-oracle/blob/master/src/oracle-api.lisp#L354 <--- looks like culprit
14:58:27
hjudt
i've used plain-odbc before, which uses the oracle oci binaries too in some way (the odbc part of it that is). it did cope well with multiple connections.
14:59:56
hjudt
p_l: could be. maybe also https://github.com/sergadin/dbd-oracle/blob/master/src/foreign-resources.lisp#L14 which should be synchronized (easy to do in sbcl)?
15:01:03
p_l
there are few, inconsistent places where the OCIEnvCreate is called, all with OCI_DEFAULT instead of OCI_THREADED
15:01:41
p_l
access to *foreign-resource-hash* should IMO also be synchronized, can be done with standard Bordeaux-Threads code
15:02:30
hjudt
p_l: i've used sbcl's (make-hash-table :synchronized t). but as you mentioned, this is probably not the only culprit.
15:02:50
p_l
so you end up with C code messing with itself, and if that causes an address written to by C code to suddenly point elsewhere because of a race condition on data structure... welll
15:06:34
hjudt
i guess i will have to read up on oci docs if i want to try to fix this. unfortunately, this seems to be the only oracle library remaining for common lisp.
15:22:14
neirac
I'm trying to use clack it was working fine in ccl but I changed to sbcl and trying to load it gives me: Retry compiling #<IRONCLAD-SOURCE-FILE "ironclad" "src" "common">.
15:25:35
p_l
hjudt: just also make sure that access to lisp-side structures is synchronized properly
15:27:14
scymtym
neirac: some ironclad versions and sbcl versions don't work together. unfortunately, the easiest solution is upgrading both to the newest released versions
15:27:19
hjudt
p_l: thanks, i will look into this and see what i can achieve, though i am not sure i have enough experience to fix it. nevertheless it is worth a try.
18:00:35
neirac
anyone using https://github.com/joaotavora/snooze ? I'm just getting 500 don't know why
21:11:02
borei
can somebody gimme heads-up, im trying to pull property from the plist but getting nil.
21:13:51
pjb
borei: (eval "(get-properties metrics '(|tags|))") #| --> "(get-properties metrics '(|tags|))" |# ;doesn't seem to work.
21:22:20
neirac
I'm stuck trying to use https://github.com/joaotavora/snooze every route I create ends with 500 internal error. https://pastebin.com/CmEY7x7H
21:30:31
Xach
neirac: here's a fun thing you can do: (map 'vector (lambda (x y) (cons x y)) names prices) can be changed to (map 'vector 'cons names prices)
21:32:19
sjl_
Does anyone have any experience using RESTART-CASE's :test along with HANDLER-BIND? I can't understand how I'm supposed to used the two together.
21:33:07
sjl_
So in bar, I want to offer a restart IGNORE-BORKED if there's an error of type BORK inside foo, but not for any other error (e.g. division by zero)
21:33:44
sjl_
Using :test borkp there works great, and I can see in the debugger that I only get the restart offered to me when the error is from the bork. I don't get it if I pass 0. Perfect.
21:34:11
sjl_
But then when I try to use handler-bind to invoke that restart programatically, it says there's no IGNORE-BORKED restart active.
21:34:33
sjl_
If I remove the :test from restart case, I *can* invoke the restart with the handler-bind, but then I also get it offered to me when it's not applicable
21:36:53
Bike
i wonder if using invoke-restart like that means the knowledge of what condition is in play is lost
21:37:57
sjl_
This happens in both SBCL and CCL so it must be something I just haven't wrapped my head around
21:38:31
sjl_
I mean, I care about it as another data point that it's not an implementation bug, heh
21:40:01
Bike
so you could workaround with (invoke-restart (find-restart 'ignore-borked c)), let's see if that works
21:43:04
sjl_
which can be > a non-nil symbol (denoting the most recently established active restart whose name is that symbol)
21:43:43
Bike
I mean the implementation would have to do funny things, keeping track of a "current condition" or something
21:43:58
dim
ACTION has spent some time on the pgloader documentation, it's getting near where I wanted it to be: https://pgloader.readthedocs.io/en/latest/index.html
21:44:47
scymtym
sjl_: could this be the problem (from the RESTART-CASE page): "If the restartable-form is a list whose car is any of the symbols signal, error, cerror, or warn (or is a macro form which macroexpands into such a list), then with-condition-restarts is used implicitly to associate the indicated restarts with the condition to be signaled. "
21:45:08
dim
IOW: hey, here's the kind of project you can implement all by yourself when using CL, here's how much user experience improvements you can actually code because everything is suddenly made easy by the language ;-)
21:46:03
Bike
(defun invoke-restart-with-condition (restart condition &rest args) (apply #'invoke-restart (find-restart restart condition) args))
21:46:19
specbot
Associating a Restart with a Condition: http://www.lispworks.com/reference/HyperSpec/Body/09_adbd.htm
21:47:31
sjl_
Yeah. I can just wrap up the invoke-restart in a helper function like people often do, using the long form of find-restart
22:13:08
kdridi
I'm looking for a serie of exercize that can make a lisp beginner an advanced programmer
22:14:10
kdridi
I tried many ways like website like project euler, hacker rank and so on but their execize are not adapted to lisp languages
22:16:29
sjl_
I've done a bunch of Project Euler, Advent of Code, and Rosalind in Common Lisp. CL works fine for all of them (and I've found it especially good for Euler)
22:21:30
nirved
neirac: in your case in defroute name is a symbol, while return-cheapest expects a string
22:21:41
kdridi
hum... for example, I'm looking for "exercises" that's ask to to create macro and do metaprogrammation
22:22:20
sjl_
Someone should write a Learn Common Lisp the Hard Way that's just a long workbook of exercises in gradually-increasing difficulty, exploring various parts of the language.
22:27:33
sjl_
1449 bought the one like that I did for Vimscript (even though it's also completely free online)