IRC channel logs

2017-07-08.log

back to list of logs

<cmaloney>quick "I don't get it" question: if I do (eqv? "5" "5") in guile I get #f, but in racket I get #t. Is eqv? implementation dependent and if so what is guile doing differently?
<janneke>eqv? is for object equivalence
<janneke>two strings may or may not be the same object
<janneke>note that Guile's reply will yield #t
<janneke>*repl
<cmaloney>2.0.9 I'm getting:
<cmaloney>scheme@(guile-user)> (eqv? "5" "5")
<cmaloney>$11 = #f
<cmaloney>and it says for characters and numbers that if they contain the same value then they return #t
<cmaloney>I'm seeing that equal? is returning #t, which I expected
<cmaloney>but the difference between eqv? is puzzling. :)
<daviid>cmaloney: not for characters, I thing you are miss reading the doc here
<cmaloney>I could be
<daviid>cmaloney: but anyway, better use string=? on strings
<janneke>cmaloney: wow, 2.0.9 -- that's ancient
<cmaloney>janneke: Blame Ubuntu. They don't bump to 2.0.13 until 17.04
<cmaloney>daviid: Right, I get that. I'm trying to explain this to other folks and just noticed a discrepancy that I wanted to clarify. :)
<janneke>cmaloney: how sad; oh well, as long as their users/customers are happy ;-)
<daviid>cmaloney: I think you are confusing characters and strings
<amz3>héllo
<cmaloney>daviid: I think I'm more confused at how eqv is different between racket and guile. ;)
<cmaloney>and racket is treating "5" as equivalent, whereas guile isn't.
<daviid>cmaloney: so, this will do what you think: (eqv? #\\5 #\\5)
<daviid>$2 = #t
<cmaloney>was describing the difference between eq, eqv, and equal in the context of "eq? does direct comparisons without checking type or value, whereas equal? does a deeper compare)
<cmaloney>and wanted to include eqv in that explanation, but I think I'll leave that out
<cmaloney>this is for folks who haven't necessarily seen scheme before, and it looks like this gets into implementation details
<daviid>cmaloney: eqv? works fine :), but the doc says for numbers and characters... then you pass a string, which has 'nothing to do with'
<daviid>scheme@(guile-user)> (equal? "5" "5")
<daviid>$3 = #t
<cmaloney>right. So it looks like there is a difference of implementation between racket and guile
<daviid>scheme@(guile-user)> (string=? "5" "5")
<daviid>$4 = #t
<daviid>yes, but guile is right
<cmaloney>for guile yes. ;)
<cmaloney>racket has a different right. ;)
<cmaloney>I think I have my answer though. Thank you for the clarification.
<cmaloney>(and yes, I'm going to hand-wave eqv and show equal? and string=? for string comparison)
<janneke>cmaloney: there's a difference of implementation in guile 2.0.9 and guile 2.0.13, and guile 2.2 and ...
<janneke>most probably you can find similar differences in different racket versions too?
<cmaloney>janneke: Possibly. I'm not sure as I haven't looked
<cmaloney>adding it to the list of things that I find charming about scheme dialects
<cmaloney>thank you, all.
<daviid>I managed to completely lock my erc buffers, no idea how...
<cmaloney>daviid: Ugh, that's no fun
<daviid>yes, especially when you are talking to someone... had to kill restart... but ok
<cmaloney>heh
<cmaloney>no worries.
<cmaloney>Oh this is fun
<cmaloney>2.0.13: (eqv? "5" "5") => #t
<cmaloney>so it even changed between point releases. :-D
<cmaloney>yeah, totally hand-waving this for this presentation
<cmaloney>OK, I think I have this sorted then. Thanks again, all
<stis>cmaloney: I think that string literals changed so that they share the same string object if put as literals in source code, that's why you get that behavior
<stis>(let ((a (make-string 1)) (b (make-string 1))) (string-set! a 0 #\\5) (string-set! b 0 #\\5) (list a b (eqv? a b)))
<stis>$2 = ("5" "5" #f)
<stis>(eqv? "5" "5")
<stis>$3 = #t
<stis>scheme@(guile-user)>
<cmaloney>stis: Right
<amz3>what's up #guile?
<OrangeShark>hey amz3
<stis>hey amz2: I'm trying to understand the consistency of a model.
<amz3>stis: which model?
<amz3>I am still stuck while trying to port guile-websocket to fibers https://github.com/wingo/fibers/issues/8
<stis>I'm reading a book that try to discuss what happens when you build an object by covering a spherical shell with loops of charges and a current.
<stis>Very difficult book
<amz3>okay!
<amz3>I feel stupid with my webdev stuff
<stis>hecking for Guile version >= 2.0.9... configure: error: Guile 2.0.9 required, but 2.2.2 found
<stis>?
<stis>don't you need guile 2.2 stuff for this
<daviid>stis: guile's autoconf macros have been updated, quite a while ago then once more recently, so it appears you have an (quite) old guile.m4 in the way ...
<stis>do you use https://www.gnu.org/software/guile/manual/guile.html#Non_002dBlocking-I_002fO
<stis>(use-modules (ice-9 suspendable-ports))
<stis>(install-suspendable-ports!)
<amz3>No, I mean Yes via guile-fibers
<amz3>OT: it's far too hot here
<davexunit>I find fibers to be very difficult to use
<davexunit>I've tried a couple of times and each time some weird stuff happens that I can't figure out
<davexunit>so I jus tgo back to my own implementation
<stis>amz3: the code in that repo seam to be old, not sure how to help then
<stis>also I have problems loading fibers, I get
<stis>ibtool: Version mismatch error. This is libtool 2.4.2 Debian-2.4.2-1ubuntu2, but the
<stis>libtool: definition of this LT_INIT comes from libtool 2.4.6.
<stis>libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1ubuntu2
<amz3>stis: are you saying that you are trying to help me?
<stis>well trying at least, thinks that fibers are a fun project
<amz3>I am recording a video about wiredtiger right now
<amz3>I will go back to fiber thing just in 30 minutes or so
<stis>coolio
<amz3>AFAIK paroneayea successfully integrated guile-fibers with 8sync so it must be possible to integrate with guile-websocket
<amz3>this issue is a road blocker for my guile hacking
<amz3>I can't hack on guile without websocket support otherwise, I will need to wait for ijp to finish its work on javascript backend (or maybe, better help)
<amz3>I could work on my imap implementation...
<amz3>nalaginrut: o/
<amz3>nalaginrut: I just discovered that the conference you participated in, is rated A*
<amz3>!
<amz3>I don't understand, it seems like the guile-websocket on fibers works
<amz3>it the first time, I think something doesn't work and actually it works
<amz3>most of the time it's I am facing the reverse situation
<amz3>well, I was not prepared for that situation, this unlocks a lot of possibilies
<amz3>sorry, it doesn't work.
<amz3>I will stop making noise on the channel and try to debug this
<amz3>so it hangs on 'write-response' from (web response)
<amz3>not really, but it still hangs.
<amz3>I know, I will try wireshark
<amz3>Here is small video about guile-wiredtiger https://youtu.be/nzOtkaxwGME
<amz3>this fibers websocket things will remain a mistery