freenode/#lisp - IRC Chatlog
Search
18:41:46
vsync
what does this mean? "| foo-bar | type-slot, converting FOO to BAR |" on http://www.cliki.net/naming+conventions
18:44:57
phoe_
this function, when given a symbol, extracts a package that this symbol belongs to, and returns that package
18:45:39
phoe_
generic-function-methods - accepts a generic function, returns all of its method objects
20:46:43
emaczen`
I'm using CFFI with opencv and I've defined (defcfun "cvNamedWindow" :int (name :string) (flags :int)), and it will open a window with CCL but not SBCL
20:54:25
jackdaniel
emaczen`: one thing is that you must call this function from your main thread (starting one)
20:58:48
jmercouris
any more recent performance benchmarks than these: http://www.cliki.net/Performance%20Benchmarks?
21:00:40
jackdaniel
jmercouris: https://common-lisp.net/project/ecl/static/files/misc/benchmarks/2016-05-bench-all.html
21:28:17
Josh_2
So I have this code http://paste.lisp.org/display/358158 and It currently enters the debugger and lets me choose my restart (division-by-zero-1 ..) however it is written like the example at the top of PCL page 240. I'm a lot confused about this.
21:32:57
jmercouris
like for example a defmacro that expands to a particular code on OSX and a different one on Linux
21:36:36
basket
jmercouris: You want the #+ read macro, you would use it like #+linux (foo) and foo would be evaluated iff :linux is in *features*, otherwise it's as if it were commented out
21:39:03
_death
Josh_2: there are several issues.. you define a DIVISION-BY-ZERO-1 condition, but never signal it.. when the division by zero will occur, a DIVISION-BY-ZERO error will be signaled by lisp.. you use the same name for a restart, which is just confusing; a better name would be, say, RETURN-NIL.. in N-RANDOM, you set up a handler in each iteration, which is unnecessary, you can have it once outside the loop.. you handle DIVISION-BY-ZERO-1
21:39:03
_death
conditions, which are, again, not signaled anywhere.. your handler function takes no arguments, but it should take one - the condition object
21:43:09
Josh_2
I'm very confused and there is so much information in this chapter that I'm finding it hard to ask a specific question
21:51:25
Bike
well this is the main one. if you want to handle a condition, it has to be signaled somewhere
22:00:25
Josh_2
Well I don't have to manually trigger an error of type "division-by-zero" because (mod.. will do that on it's own, so how do I catch that with a (handler-bind instead of a handler-case
22:01:24
Bike
you have the handler specialize on DIVISION-BY-ZERO, instead of DIVISION-BY-ZERO-1 like you have now.
22:02:42
Bike
yes, you'd have to define a condition class called DIVISION-BY-ZERO-1 and signal it yourself, as by ERROR.
22:04:28
Josh_2
Okay, so now now it'll look back on the stack for a handler that can deal a division-by-zero error?
22:05:21
Bike
you can try in your repl (handler-case (mod 7 0) (division-by-zero (c) (declare (ignore c)) (print 'in-handler)))
22:06:10
Bike
i know. i'm just trying to get across how the types in handler-bind and handler-case work. that part is identical between them.
22:07:55
Josh_2
Is it? Because in PCL it says that handler-bind must take a function-object unlike handler-case
22:16:48
Josh_2
I know how to get handler-case to work. I don't know how to put the handler for division-by-zero on the stack.
22:18:18
Bike
you want to handle conditions of type DIVISION-BY-ZERO, so you'll write like (handler-bind ((division-by-zero ...)) ...)
22:23:19
Bike
you had the syntax right before, (handler-bind ((division-by-zero #'(lambda ...))) ...)
22:30:00
Bike
if you are having a specific problem, please elaborate on it, i am not looking over your shoulder
22:32:00
Bike
type is division-by-zero, handler is a function of one argument that invokes your restart, form* is going to call your function that calls mod
0:07:40
MetaYan
scymtym: ironclad timing - full logs: https://pastebin.com/P62a5WR1 (scymtym) and https://pastebin.com/0ErHUQiy (sbcl 1.4.0)
0:21:51
MetaYan
Those pastes are benchmarks for scymtym - some optimizations in SBCL. ironclad compiles in 25s instead of 66s.
2:18:32
jmercouris
I don't want to use lisp to write to it or anything, I just have to make sure it exists
2:19:12
jmercouris
I guess I can probe-file to see if it exists, but is there a way to just do like "touch"?
2:21:15
White_Flame
with with-open-file, it should just be a single clause, probably shorter than most languages
2:26:34
jmercouris
hey everyone, sometimes slime doesn't show the function I'm working on in the message buffer, like it won't show me the current parameter I am on, any reason why that could be?
2:29:54
jmercouris
It keeps putting strange stuff in my messages buffer: error in process filter: Wrong number of arguments: nil, 137
3:05:50
jmercouris
for anyone curious what the issue is, I forgotten I had patched the lisp I compiled on my system to remove the help doc...
3:54:42
jmercouris
didi: I think it should be like deleting a file, right? I mean at least on unix, a directory is just a file
4:11:26
jmercouris
I'm also thinking about how to improve the rendering performance of the actual webview
4:33:31
emaczen`
I've only ever served data that isn't constantly being updated? I'm confused in terms of that constant change
5:45:40
jmercouris
what's the best way to transform from the 1st list, to the 2nd list: https://gist.github.com/237e37287765c1682e889aa39e25236d
5:48:29
beach
jmercouris: There might be simpler solutions, but you have only given one example. Do all the sub-lists in the initial case have a single element? Does the first list always have two sub-lists? etc, etc.
5:57:56
beach
jmercouris: If you draw the box diagram of you first list, you will immediately see the solution.