IRC channel logs

2015-10-24.log

back to list of logs

<ArneBab>rekado: wingo wrote something about the guile compiler and how it helps for native compilation, just not with GCC, because that uses assumptions which do not hold true for Scheme: http://wingolog.org/archives/2013/11/26/a-register-vm-for-guile
<davexunit>ArneBab: thanks! forgot about that article
<davexunit>I like this: Guile "runs faster than other "scripting language" implementations like Python (CPython) or Ruby (MRI)."
<ArneBab>davexunit: yes — I wish we already had the 2.2 ELF formatted modules
<rekado>ArneBab: nice!
<rekado>I think I read this article some months ago, but it's a good read anyway.
<daviid>happy sunday guilers!
<roelj>If I have: (define predicates '((lambda (x) (> x 100)) (lambda (x) (< x +inf.0)))). How can I evaluate (car predicates) with a binding for x?
<paroneayea>hi daviid, *!
<daviid>roelj: why not pred< and pred> what makes you decide if you want the car or the cadr ?
<daviid>hi paroneayea
<daviid>paroneayea: i'm fighting guile-lib autotool chain POSIX compliance and a make distcheck problem, hope to solve these today :)
<roelj>daviid: I thought it'be easier to evaluate one lambda if I had extracted it from the list.
<roelj>daviid: What does pred< and pred> do? (I'm searching for the part in the reference manual)
<daviid>roelj: don't know what your are up to, but I would define 2 predicates
<daviid>(define (pred< x) (< x 100)) and ...
<roelj>daviid: I'm trying to assemble a list of predicates while the program is running, so the list of predicates should grow while it runs.
<taylan>roelj: you can do (define predicates (list (lambda (x) (> x 100)) (lambda (x) (< x +inf.0)))) so you directly store procedure objects in the list, not syntax forms that need to be evaluated later.
<roelj>taylan: Yeah, that does it! I wasn't aware '() was different from (list ...). I really need to learn so much still..
<davexunit>roelj: ' is short for 'quote'
<davexunit>the quoted expression is not evaluated as code, but treated as data.
<roelj>Right. And what exactly is the difference between (a . b) and (a b)?
<ft>(cons a b) vs (cons a (cons b '()))
<ft>well, I forgot a few 's in there.
<ft>(cons 'a 'b) vs (cons 'a (cons 'b '()))
<roelj>Are both forms the same list structures, and the dot is a notational thing?
<taylan>(x y) is really short for (x . (y . ()))
<taylan>whereas (x . y) is just that
<ft>This is so much easier with pictures.
<ft> https://en.wikipedia.org/wiki/Cons
<taylan> http://taylanub.github.io/doc/lisp-rundown.html maybe this can help a bit too, though it's very dry
<roelj>A ha
<roelj>thanks guys!
<daviid>roelj: here is the link of a good intro to scheme [although it has lisp in the name, it is about scheme :)] http://www.bcl.hamilton.ie/~nmh/t3x.org/zzz/sketchy-lisp.zip if you are interested, download unzip and locally have fun .. [there are other intro material, just a tip...
<roelj>daviid: Thanks!
<roelj>I read the r5rs report and the Guile reference manual (partly). I find it hard to apply everything.
<roelj>I guess it's a matter of practising.
<roelj>Is this properly tail-recursive? http://paste.lisp.org/+3DGA
<mark_weaver>roelj: yes
<roelj>mark_weaver: Thanks