Search
Thursday, 13th of February 2020, 1:28:42 UTC
3:36:10
Lord_of_Life_
** NICK Lord_of_Life
4:23:21
beach
Good morning everyone!
4:30:49
no-defun-allowed
Good morning beach!
7:42:42
no-defun-allowed
Good morning phoe!
11:44:19
Xach
Today is a Quicklisp release day
11:46:09
Josh_2
Happy Quicklisp release day :D
11:46:18
decent-username
Xach: What exactly does that mean? Are we out of beta?
12:08:06
Xach
decent-username: i am too terse. i meant a quicklisp dist release, not a quicklisp non-beta release.
13:00:49
Cymew
Talking about that. How goes the effort to get out of beta?
13:07:51
Xach
Cymew: very very slow. there are many tasks and little progress is made.
13:08:45
Xach
I do what I can to keep updates coming, but it's been slow progress on other stuff.
13:09:12
jmercouris
I have the following code: http://dpaste.com/15ZXX2D
13:09:39
jmercouris
what I would like to do is pass the callback function from web-view-execute to be executed in js-execution-complete
13:11:02
jmercouris
I don't know how to do that though since js-execution-complete is a cffi callback
13:12:38
jmercouris
my only ideas so far are to use global state, but I don't like that
13:12:49
shka_
https://common-lisp.net/project/cffi/manual/html_node/get_002dcallback.html ?
13:13:22
jmercouris
shka_: I don't understand where you are going with this
13:13:52
shka_
jmercouris: get-callback allows you to obtain callback object from a symbol
13:15:59
Nilby
Xach: Do you have a quicklisp todo list somewhere I could help remove things from?
13:21:18
jmercouris
OK, shka_ and what will I do with the callback-object?
13:21:23
shka_
jmercouris: (cffi:foreign-funcall-pointer (cffi:get-callback 'callback-no-arguments) ())
13:21:40
jmercouris
I can't call the callback function though
13:21:57
jmercouris
it is handled by webkit2:webkit-web-view-run-javascript
13:22:12
shka_
this is function that can be called like C callback, so call it like c callback
13:22:35
jmercouris
it is like a C callback
13:22:43
jmercouris
so you are saying I can substitute my own callback functio
13:22:55
jmercouris
instead of js-execution-complete?
13:23:00
shka_
i think i don't understand this, let me read
13:23:15
jmercouris
let me try to re-explain
13:23:35
jmercouris
I have webkit-web-view-run-javascript which runs some javascript in C land, and calls js-execution-complete with the result of that javascript
13:23:48
jmercouris
I want to take that javascript result and call my OWN callback
13:23:56
jmercouris
which I specify by passing into web-view-execute
13:24:10
jmercouris
does that make more sense?
13:24:59
jmercouris
so my original way of doing this was having some global state like (defparamater callback-fn (lambda (x) (print x))) and then I'd funcall (callback-fn..) within js-execution-complete
13:25:12
shka_
ok, so i suggest to define callback with defcallback, pass it as pointer whetever it is needed, and then foreign-funcall-pointer it when it is needed
13:25:43
jmercouris
can you please explain this further for me, I'm not sure I understand
13:25:59
jmercouris
I have a defcallback already made
13:26:03
jmercouris
what is the purpose of this new one?
13:26:34
shka_
ok so you have js-execution-complete callback
13:26:45
jmercouris
and it accepts the correct number of arguments
13:26:59
shka_
and you want to call another callback within it
13:27:00
jmercouris
which will be automatically invoked by webkit-web-view-run-javascript WHEN the javascript has completed evaluation
13:27:08
jmercouris
I want to call my own custom callback within it
13:27:21
jmercouris
I want it to be a simple lisp function that accepts one argument
13:27:28
jmercouris
(defun my-callback (x) (print x))
13:27:50
shka_
ok, so typically C APIs work by passing void* pointers holding arbitrary state
13:28:03
jmercouris
I'm not sure, I don't remember the API
Thursday, 13th of February 2020, 13:28:42 UTC