IRC channel logs

2020-02-08.log

back to list of logs

<daviid>i was thinking a returned value, but this is an argument
<str1ngs>I think the return value is handled okay
<daviid>it's unfortunate i can't play with a snipset, and also that i kow nothig about webkit :)
<daviid>str1ngs: yes, the returned value is a boolean, iiuc
<str1ngs>I understand, that's party why I didnt want to bother you with it. even if you installed unstable webkitgtk you would need a web extention to talk too.
<daviid>but the argument value, since the ignal callbackis scheme code, what are you doing with it? (not sure my question is clear)
<str1ngs>I'm using this to communicate with the webprocess. primarily right now it just loads and calls some javascript
<str1ngs>but later I'd like to use it for dom introspection ie html forms etc
<daviid>str1ngs: so your signal code look like this: have (lambda (web-page message) ...)?
<str1ngs>it looks like that but it's actually (webview message)
<daviid>ok, and you say that message is #f, instead of a ponter to ...
<str1ngs>right
<daviid>instead of a <web-kit-user-message> instance I meant to write
<str1ngs>that's correct its <boolean>
<str1ngs>with the value of #f
<daviid>str1ngs: but it shuld be a <web-kit-user-message> instance?
<daviid>str1ngs: the code to look at wrt g-closure invocation args is g-closure-marshal and g-closure-marshal-g-value-ref, line 223 and 251 respectively
<daviid>to see what webkit 'gives you', you can peek (or dimfi) the value, line 252
<daviid>(let ((value (dimfi (g-value-ref g-value)))) instead of (let ((value (g-value-ref g-value))), at least tempo
<daviid>i think t might be a bug on g-golf
<daviid>I wish you can paste the result of the peek, if it is a 'valid pointer', then there is a bug i g-golf
<str1ngs>daviid: will peek and let you know
<daviid>str1ngs: can you also peek the type
<daviid> (case (dimfi (g-value->g-type g-value)) insteas of (case (g-value->g-type g-value), tempo as wel ...
<str1ngs>g-value->g-type?
<daviid>it should be object
<daviid>line 253, do this (case (dimfi (g-value->g-type g-value))
<str1ngs>okay
<daviid>then you'll revert these small debug changes ...
<daviid>it will show those peeks for both arguments of course, and webview should be a pointer and should have the object type as well ...
<daviid>let's see
<str1ngs>will take a bit to switch to local build of g-golf vs guix package.
<str1ngs>I can't easily test this in a REPL
<daviid>it's ok, take your time
<daviid>ah yes, patching g-golf in guix isn't that easy
<daviid>maybe you can do that in your host distro instead ...
<str1ngs>I have a local build of g-golf on my host ubuntu. but lately I've been using guix more lol
<str1ngs>let me reboot. it will be easier to use a local buidl for this
<daviid>i understand
<daviid>i didn't think you had to reboot, thought you were running guix as an ubuntu host ... too bad
<str1ngs>daviid will be while before I can test this. I have a chicken egg problem were webkit is to old on my host system. at least I know where to look now thanks. and it's getting late in my work day
<daviid>str1ngs: it's ok, but i think it is a g-golf bug. can you tell me fro the top of your head if this argument receives a new instance, each call?
<str1ngs>daviid off hand I'm not sure . I make a new instance of the message when replying . but because this uses dbus it might get marshalled and unmarshalled.
<daviid>str1ngs: but it not an isance 'of yours' right?
<str1ngs>**** replay is 0x7f31c8005ab0
<str1ngs>**** massage: is class: #<<class> <boolean> 7fc5787eb2d0>
<str1ngs>daviid: looks the instance is the same from creation till when the message is passed to the closure
<daviid>str1ngs: so the pointer is a valid pointer
<str1ngs>it's valid at creation. but let me double check
<daviid>i wanted to know the type
<daviid>the <class> ... is suspicious to me, as i that is not what i wanted, i thik, what i wnted, is this
<daviid> (g-value->g-type g-value)
<daviid>that is never a class, it is a symbol, or am i wrong?
<daviid>did you patch line 253 for this: (case (dimfi (g-value->g-type g-value)) ... that is the type i'm looking for
<daviid>it should be a long, like this 94891814062432
<daviid>just an example of course ...
<daviid>this i patsed is the <clutter-actor> class gtype-id - which is a dynamic value, it changes from session to seson ...
<daviid>str1ngs: do you have access to a repl? where you'd have imported the WebKitUserMessage class?
<str1ngs>I can't use a REPL because it requires a webkit process
<str1ngs>ie a web extention so there is no way to message
<daviid>ok, but i did mis exprss myself, let me paste a code
<daviid>just a minute
<daviid>if you did change the line 253, i'd expect that in the (current-output-port) you's see 'object
<daviid>can you confirm this?
<str1ngs>to debug g-golf I need to a local install g-golf on guix which is not possible. or local webkit won host system
<daviid>because (g-value->g-type g-value) in this argument case is 'object
<daviid>right?
<str1ngs>so I can not confirm that right now. I can make the changes just it will take sometime to setup
<daviid>let's stick to your ubutu image for now ...
<daviid>i just need a few confirmation
<str1ngs>yes but then ubuntu's webkit is to old then I need to locally build webkit
<daviid>ah
<str1ngs>so it will take some time to set this up. but I can set this up. the main thing is I know where to look now as well
<daviid>str1ngs: i'll pste a version of g-closure-marshal-g-value-ref i'd like you to use in a sec
<str1ngs>ok that will help or a patch even
<daviid>i don't want to patch, because it's going to peek, a temporary thing
<daviid>str1ngs: https://paste.debian.net/1129729/
<daviid>could you paste and use this version temporarily, in (g-golf hl-api closure)
<str1ngs>okay will take me bit to text
<str1ngs>test*
<str1ngs>daviid: ;; object
<str1ngs>;; 35914080
<str1ngs>;; string
<str1ngs>I'm not sure if that's the right signal. I'd have to isolate more
<daviid>that 35914080 doesn't sound correct, i din't know where the 'string' comes from, there are only to peeks i the paste i proposed
<str1ngs>daviid: that's not right i forgot to uncomment the scheme closure
<daviid>but lt me add another peek, just a sec
<str1ngs>daviid: let me isolate this more so there is less signal noise
<str1ngs>**** sending message as pointer: 0x7f61400050d0
<str1ngs>;; object
<str1ngs>;; 34692928
<str1ngs>;; object
<str1ngs>;; 32580400
<str1ngs>I'm not sure why there are two signals there
<daviid>str1ngs: two argumets, not two signals
<str1ngs>ah that makes more sense
<daviid>but i think that's what i thought, not a bug, but a 'limitation', which i know what to do, let me try to fix this
<daviid>if not today, i hope by tomorrow ...
<str1ngs>ahh great, sorry for the slow debugging. and it's not important I have a work around
<daviid>str1ngs: it is very important for g-golf, thanks for this report ..
<str1ngs>no worries, this is a hard example to work with lol
<daviid>str1ngs: it's ok, i know what happens, but i'll need you to test, i don't have such a example 'at hand' ...
***apteryx is now known as Guest43926
***apteryx_ is now known as apteryx
***ng0_ is now known as ng0
***ng0_ is now known as ng0
<rlb>There's no facility for defining GOOPs <procedure> subclasses is there? i.e. to be able to have something that behaves exactly like a procedure, but is also recognizable via define-method?
<oni-on-ion>surely with MOP
<oni-on-ion>there must surely be a way for just that. do you have a small code sample ?
<RhodiumToad>ooh
<RhodiumToad>you can subclass <applicable-struct> and put something in the #:procedure slot
<RhodiumToad>this appears not to be documented at all
<rlb>RhodiumToad: ahh, yeah, that sounds like exactly the kind of thing that'd work.
<rlb>oni-on-ion: I would just need to be able to create an instance that when placed in the first position in a call, i.e. the foo in (foo 1 2 3) would result in a call to a function I specify. But foo must also be recognizable as some class via define-methods.
<RhodiumToad>well I tried a trivial example and it worked
<RhodiumToad>(define-class <mything> (<applicable-struct>)) (let ((o (make <mything> #:procedure (lambda x (pk x))))) (o 'foo'))
<oni-on-ion>rlb, ahh yeah. let us know how it worked out
<rlb>wingo: any idea if that's something that might be "stable" and/or we might eventually support officially, or think relying on it is likely to be forseeably "risky"?
<RhodiumToad>that last ' was a typo but it still works
<RhodiumToad>I tested on 2.2.6.
<rlb>RhodiumToad: ok, right -- thanks much.
<rlb>For what it's worth (and ignoring any questions about their advisability), one use case is something like clojure's "invokable" sets and maps (including vectors), i.e. (some-map :key) looks up the key in the map: https://clojure.org/reference/data_structures#Maps
<rlb>(Which are sometimes handy, e.g. compositionally.)
<RhodiumToad>with goops, is it possible for the constructor for some class to provide new/different initialization parameters for the initialization of a superclass?
<rlb>RhodiumToad: without delving, I'd imagine that'd be via specialization of initialize, use of next-method, etc.
<RhodiumToad>right, but next-method doesn't take args, it can only pass on the exact args from the caller
<RhodiumToad>there's no way to say "call the next-less-specialized method but with these other args instead"
<RhodiumToad>hence the question
<rlb>Oh, I hadn't noticed/remembered that (clearly).
<rlb>(I forget what clos does there...)
<RhodiumToad>it seems a fairly serious limitation
<rlb>Unless there's a workaround, could certainly affect some class designs.
<RhodiumToad>if there's a workaround it's not documented and nor is it obvious