IRC channel logs

2017-01-14.log

back to list of logs

***logicmoo is now known as dmiles
<amz3`>héllo :)
<amz3`>civodul: sorry I don't have time to work on guile-git right now, I need to prepare my talk
<civodul>hi!
<civodul>no problem
<amz3`>hi :)
<janneke>hi!
<jmd>Why is it that I cannot use a procedure as an optional keyword?
<ft>Pretty sure you can. How are you doing it?
<jmd>Oh sorry. My bad.
<paroneayea>davexunit: you have anywhere the .html and .js files you used to test out guile-websocket?
<paroneayea>ACTION will bbiab tho!
<janneke>paroneayea: i was wondering about that too, added a small test for my websocket-over-http-socket patch; https://lists.gnu.org/archive/html/guile-devel/2016-08/msg00010.html
<janneke>thaht needs to be reworked in some way to get into websocket/guile, but I have no idea how
<rekado>I’m trying to use read-hash-extend to make string input prettier in a file
<rekado>(use-modules (ice-9 rdelim)) (read-hash-extend #\\s (lambda (char port) (read-string port)))
<rekado>however, the above just hangs forever.
<rekado>when I restrict read-string by adding a count it does work.
<rekado>should I expect this behaviour?
<random-nick>rekado: the port is the whole file, you probably don't want to read-string it
<random-nick>well, the whole file after the read macro was encountered
<rekado>oh, I need to disengage when reading the character again
<rekado>I assumed that was handled automatically somehowe
<rekado>*somehow
<paroneayea>oh thanks janneke :)
<janneke>paroneayea: yw -- you'll have to use different sockets with vanilla websockets, of course
<paroneayea>janneke: I was thinking about taking this route of combined socket anyway
<paroneayea>so it's great to see you already did research into it
<paroneayea>I've saved the patch.
<paroneayea>ahh, eww makes reading html versions of rfc so nice in emacs :)
<janneke>paroneayea: glad you think it makes sense -- my patch is flawed though and I as yet failed to inspire davexunit about the need to somehow combine http and websockets
<paroneayea>janneke: I haven't read it yet, but I'm sure it'll be useful material to study regardless :)
<janneke>paroneayea: :-)
<janneke>apropos fset/clone...
<janneke>what i would really like is set of multiple fields (my clone does that) but also deep fields, like srfi-9-gnu
<janneke>paroneayea: did you look at that -- do you have such need?
<paroneayea>janneke: I'm not sure I follow, do you mean something like a common lisp "setter"
<paroneayea>eg the accessors in GOOPS?
<paroneayea>oh I see
<paroneayea>(set-fields rms ((person-address address-street) "Temple Place"))
<paroneayea>like that?
<paroneayea>from the docs?
<janneke>yep
<paroneayea>janneke: it's not as useful to me, but it would be cool to have
<paroneayea>I mean, for my immediate purposes
<paroneayea>in the long run, could be nice
<paroneayea>janneke: I'm also not sure, I didn't fully look at how srfi-9 gnu works
<paroneayea>whether it does a full O(n) copy of the record
<paroneayea>or if it's able to be smarter somehow
<paroneayea>and only copy the fields needed
<paroneayea>I guess it would have to do a full copy
<janneke>yes
<paroneayea>since I think the records use a vector type datastructure under the hood
<paroneayea>probably since most GOOPS classes don't have too many slots, it's fine to do that
<paroneayea>the O(n) cost of copying might not be much more than the cost of fancy functional datastructure mechanics :)
<janneke>i liked my (clone o #:slot <value> ...) approach
<janneke>but not sure how to translate that template to deep setters
<paroneayea>janneke: yes it's nice, though #:init-keywords don't quite line up with slot names necessarily
<paroneayea>which is possibly a problem
<janneke>paroneayea: in my goops they always do...
<paroneayea>janneke: right "necessarily" I say :)
<janneke>sure :-)
<paroneayea>maybe it's ok for the only ones you are allowed to change are the ones with #:init-keyword fields
<janneke>i just wonder what the feature of having to specify them all is
<janneke>oh well
<paroneayea>janneke: I didn't parse that last one
<paroneayea>oh
<paroneayea>wait now I get it
<paroneayea>janneke: I think it's because of CLOS-style resiliency to "evolving models"
<paroneayea>you might have a slot that changes what its slots are and how they work over time, but support the old interface...
<janneke>i just always use stuff like
<janneke>(define-class <var> (<ast>)
<janneke> (name :accessor .name :init-value #f :init-keyword :name))
<janneke>.. <name> .. .<name> .. #:<name>
<paroneayea>janneke: here's another way to do clone maybe
<paroneayea>(clone rms ((person-age) 60) ((person-address address-street) "Temple Place"))
<paroneayea>closer to set-fields semantics
<paroneayea>janneke: wdyt?
<janneke>yes, that could work
<paroneayea>janneke: and if you just wanted to change one, you could do (slot-fset)
<janneke>i'll go play with that
<paroneayea>or something
<janneke>yes
<jmd>I don't understand what (const 2) does
<paroneayea>jmd: it produces a procedure like this
<paroneayea>(lambda _ 2)
<janneke>i didn't consider something so much alike srfi-9-gnu, as i was stuck on the #:key <value> idea
<paroneayea>the _ instead of an argument list means ignore input
<paroneayea>so it will always, no matter what, return 2
<paroneayea>((const 2) 'all 'these 'are 'ignored) => 2
<paroneayea>janneke: yeah, I understand, it looks more like a goops constructor that way
<paroneayea>(clone rms ((#:person-age) 60) ((#:person-address #:address-street) "Temple Place"))
<paroneayea>might still work too
<janneke>hmm...yes
<paroneayea>though the advantage of the clone version above is it ignores the wibbley-wobbliness of keywords not always matching up to the slot names
<janneke>yep
<paroneayea>oh
<paroneayea>hmmmm!
<paroneayea>I just thought of something
<paroneayea>wait this is possibly a terrible idea :)
<janneke>good!
<janneke>:-)
<paroneayea>janneke: this would actually be closer to slot-set!
<paroneayea>(clone rms ((age) 60) ((address street) "Temple Place"))
<paroneayea>because you wouldn't need the person-
<paroneayea>but
<paroneayea>you *could* do it via accessors.
<paroneayea>but you'd have to do a full clone, even of the fields you're replacing, first.
<paroneayea>and then apply the accessors
<paroneayea>that might not be nice.
<paroneayea>though, now that I'm looking at it
<paroneayea>I kinda like
<paroneayea>(clone rms ((age) 60) ((address street) "Temple Place"))
<paroneayea>so short :)
<janneke>yes, it gets better
<janneke>i'm wondering if there's something we can learn/steal from the
<janneke>(set! (.slot x) <value>) idea
<paroneayea>janneke: you mean clojure-like?
<paroneayea>does that even exist in guile-land?
<janneke>but then (fset! (.slot x) <value>)
<janneke>GOOPS has that
<paroneayea>well no need for ! in fset
<paroneayea>oh really??
<janneke>ah, no
<paroneayea>it does?
<janneke>just fset :-)
<janneke>and then combine (fset ..) with clone and deep field setters ... something like that
<paroneayea>janneke: can you show me an example of how to do (.slot)
<paroneayea>on anything
<paroneayea>I didn't think GOOPS supported "dot notation"
<paroneayea>I mean I guess you could supply an accessor that looks like dot notation
<janneke> https://www.gnu.org/software/guile/docs/goops/Slot-description.html
<janneke>paroneayea: yes, the `.' prefix is a janneke-ism
<paroneayea>ohhhh
<paroneayea>janneke: gotcha :)
<paroneayea>so you're talking about accessors?
<janneke>i understand many people like `@'
<janneke>indeed, sorry i forgot
<paroneayea>janneke: I hadn't considered using .foo for accessors
<paroneayea>I really like that
<paroneayea>janneke: great idea, thank you
<janneke>(it helps with my coming from OO collegues)
<janneke>:-) yw
<paroneayea>ACTION files in notes
<paroneayea>janneke: yeah that's a great idea.
<paroneayea>clojure has notation like that, and we "borrowed" it in Hy.
<paroneayea>though I think we actually
<paroneayea>yeah
<paroneayea>pretty much the same idea
<paroneayea>cool! thanks for the idea janneke
<janneke>haha, nice
<paroneayea>janneke: yes, so if we did that
<paroneayea>that would be like my suggestion of using accessors
<paroneayea>but, I think we'd have to do a full object clone
<paroneayea>*then* apply the accessors.
<paroneayea>janneke: I think both of these are worth experimenting with.
<paroneayea>janneke: so really, the "right" way to do it via accessors
<paroneayea>would be to first use shallow-clone from goops to copy the whole thing, then apply the accessors
<paroneayea>possibly recursively
<janneke>yes...
<janneke>possibly this is not such a problem
<paroneayea>janneke: that route should be very feasible.
<paroneayea>janneke: I'm going to mock this up
<paroneayea>this can't be too ahrd.
<paroneayea>hard
<janneke>oh great
<paroneayea>janneke: WOW! I got it :D
<paroneayea>wanna see?
<janneke>paroneayea: yeah, sure!
<janneke>*please
<paroneayea>janneke: http://paste.lisp.org/display/336583
<paroneayea>janneke: WDYT? I think it's pretty good :)
<paroneayea>ACTION should update that header, since it *uses* shallow-clone now :)
<janneke>... ((.address .street) "Temple Place")) *sweet*
<paroneayea>:D
<paroneayea>janneke: maybe I should turn this into a module and submit to guile upstream?
<paroneayea>we know at least two users, being both of us ;)
<janneke>paroneayea: certainly
<janneke>it never hurts to get more perspectives on it -- and more users
<paroneayea>janneke: cool. I'll email guile-user as an update to the thread there first, then I'll work on a patch to guile proper
<janneke>i think most of wingo's GOOPS enthusiasm has run out, but you never know
<janneke>i'll be using it in any case
<paroneayea>janneke: wingo rewrote GOOPS to be in scheme not too long ago
<paroneayea>so it's not like that code is untouched
<janneke>yes, indeed he did a lot of very good/hard work there recently
<janneke>possibly i'm confusing GOOPS with guile-gtk
<janneke>guile-gnome
<paroneayea>janneke: yes daviid is now the maintainer of that
<paroneayea>anyway, with the GOOPS rewrite, I feel like personally GOOPS *has* gottten a lot of love :)
<janneke>yes
<paroneayea>it made 8sync actors work with delimited continuations much better
<paroneayea>because less stuff being called from C results in less unrewindable continuation mess
<janneke>just before the goops rewrite, about 2.5 years ago, i wrote a kind of silly library that would enable much of GOOPS client code to run on a simple lists backend
<janneke>no methods
<janneke>but (make <>) and using match to mimick generic accessors
<janneke>and a hack for ice-9 match to use record matchers ($ <> .. ) on plain lists
<janneke>because GOOPS was too slow...now we're back to GOOPS :-)
<janneke>o and paroneayea: thanks for solving my clone problem/wish!
<paroneayea>:)
<paroneayea>janneke: sent an email to guile-user
<paroneayea>feeling pretty good!
<paroneayea>oops I'd better get back to reading the websockets spec now :)
<janneke>nice mail!
<janneke>ACTION goes back to mes, finally
<paroneayea>:)
<paroneayea>janneke: oh!
<paroneayea>janneke: I remember I posted the pre-scheme thing to you
<janneke>been hunting down emacs crash stuff, not fun
<paroneayea>did I show you I found a specific paper called "A Verified Compiler for Pure PreScheme"
<paroneayea> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.5101
<janneke>not before...
<janneke>thanks!
<paroneayea>np :)