IRC channel logs

2016-01-03.log

back to list of logs

<jyc>I have a question related to that, if I have a recent version of guile installed through my package manager, can I use that instead of the slow interpreter to bootstrap?
<davidh>How can it be that (vector= eq? v1 v2) but not (equal? v1 v2) ?
<taylan>davidh: wdym (vector= eq? v1 v2)
<taylan>what actually is "vector=", don't think I ever heard of it
<davidh>7.5.30.2 SRFI-43 Predicates
<taylan>ah
<taylan>hmm, good question then, sounds like (vector= eq? v1 v2) implies (equal? v1 v2)
<taylan>davidh: what do the vectors contain?
<davidh>just #(1 1)
<taylan>scheme@(guile-user)> (equal? (vector 1 1) (vector 1 1))
<taylan>$3 = #t
<taylan>are you sure you didn't do something else wrong?
<mark_weaver>davidh: can you give me a minimal self-contained set of commands that demonstrates what you're seeing?
<mark_weaver>(equal? #(1 1) #(1 1)) returns #t for me
<taylan>ACTION goes AFK
<davidh>(let ((vec #(0 1)))
<davidh> (incf! (vector-ref vec 0))
<davidh> (values (equal? vec #(1 1)) vec))
<davidh>incf! is a self made macro
<davidh>$2 = #f
<davidh>$3 = #(1 1)
<davidh>what the repl says
<mark_weaver>davidh: you are mutating a literal, which is illegal and results in unspecified behavior
<mark_weaver>change #(0 1) to (vector 0 1)
<davidh>ahh, thanks
<mark_weaver>np!
<mark_weaver>more specifically, the compiler deduced that (equal? vec #(1 1)) is always false, based on the assumption that literals are immutable.
<mark_weaver>at some point in the future, literals will probably end up in read-only memory and thus attempts to mutate them will be detected.
<mark_weaver>actually, that might already be the case on the master branch
<mark_weaver>(for compiled code, at least)
***__ransom__ is now known as ransom_
<amz3>héllloooo :)
<xd1le>amz3: hi
<attichacker>Hello, does anyone have any recommended sources for learning about Macros in Scheme? I'm already familiar with the concept through Elisp / Elixir macros but syntax-case and friends seem to be quite different beasts.
<amz3>attichacker: +1
<davexunit>attichacker: define-syntax-rule is a good place to start
<davexunit>Scheme macros are far superior to elisp and surely whatever elixir has
<attichacker>davexunit: I'm not doubting it's superiority, I'm just having trouble actually finding a good source on it. Ideally I'd like a book or paper which purely focuses on the macro system.
<davexunit>I just read the guile manual for the most part
<amz3>attichacker: do you have a precise question? I also find that this area could help some contribution
<attichacker>All right, I'll try that again. I'm getting the hang of it more so might be easier.
<attichacker>No I don't have any specific questions at the moment. I was just trying it to get a grasp of it all, being much more complex than elisp :)
<amz3>attichacker: try to tweak an existing macro maybe
<attichacker>amz3: Yeah I'm probably going to look around other people's repos and see if I can learn from that, helps most of the time
<attichacker>Another thing though, is that I find it very difficult to find specific functions in Scheme. For example srfi and ice-9 don't really tell me anything about the library itself. I often find myself grepping through the modules hoping that I find what I need.
<amz3>attichacker: I use https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html
<amz3>attichacker: look for "REPL" paragraph at http://hypermove.net/notes/learn-scheme-guile-basics/ this will provide a "help" procedure in the REPL
<amz3>there is emacs procedure that can replace using the procedure index but I don't have it anymore
<attichacker>amz3: ahhh those links help so much!
<attichacker>Thanks, this makes my life a lot easier!
<amz3>:)
<amz3>I almost forgot, It's been one year since I wrote my first line of guile! Let's party \\o/
<amz3>even if most of my initial guile code was C code x)
<amz3>and now I can (almost) draw a graph programmatically :D
<amz3>ACTION adds edges
<attichacker>Nice!
<attichacker>
<amz3>daviid: http://paste.lisp.org/display/304416#3 :)
<amz3>there is a bug when vertices are aligned vertically or horizontaly
<amz3>I'll need to fix that and then add some dragndrop behavior
<daviid>amz3: I mentionned these 2 cases yesterday :), leaving it for you as an exercise ...
<daviid>amz3: you should not duplicate 'things', like having a record <edge> with start, end, then some procedures, and then <edge-actor> with start, end and methods: rather expand/refine <edge-actor> with what ever other slots you need, but dedundancy is [very] bad :)
<daviid>amz3: also, I would not mix 2 paradigm/coding style here, but stick to goops for everything [you define <graph> as a record type, then <edge-actor> as a class...]
<madsy>Sigh.. handling of the PATH environment variable is so damn broken on Windows :(
***Fuuzetsu is now known as Guest48559
***Fuuzetsu` is now known as Fuuzetsu