IRC channel logs

2015-03-18.log

back to list of logs

<ArneBab_>bbad
<solrize> https://en.wikipedia.org/wiki/Chibi_%28term%29 aha, that explains chibiOS and chibi scheme
<dsmith-work>solrize: Ahh!
<solrize>wow, somebody wrote a JVM in Forth and we're talking about 2.8MB of libguile :)
<solrize> https://github.com/JorthVM/JorthVM
<solrize>\\ TODO: add stuff for GC here.
<solrize>lol
***cluck` is now known as cluck
***Fuuzetsu is now known as Guest68405
***Guest68405 is now known as Fuuzetsu`
***Fuuzetsu` is now known as Fuuzetsu
***michel_mno_afk is now known as michel_mno
<civodul>Hello Guilers!
<wingo>meep meep
<nalaginrut>alright, irregex has, and it's srfi-115 now
<davexunit> http://srfi.schemers.org/srfi-115/srfi-115.html
<davexunit>cool!
<davexunit>so, when can we get this in guile? :)
***wleslie is now known as protocol_fairy
<davexunit> https://twitter.com/ID_AA_Carmack/status/577877590070919168
<davexunit>it's official, 2015 is the year of Scheme
<protocol_fairy>just putting it out there, srfi numbers do not make descriptive module names.
<davexunit>yes, we know.
<dsmith-work>Morning Greetings, Guilers
<dsmith-work>davexunit: irregex is alread in the guildhall (IIRC)
<solrize>is racket much different from scheme?
<ArneBab>is there a way to make Guile simplify equations as much as possible before reducing the exactness of numbers?
<ArneBab>for example it would be cool if the following would give exactly 1: (define pi 3.141592654)(/ (* 1 pi) pi)
<christoph_debian>hi! I'm trying to add to %load-path from within C ..
<christoph_debian>scm_call_1(scm_c_public_ref("guile", "add-to-load-path"), scm_from_locale_string("/test/")) errors out and there doesn't seem to be a more native way?
<christoph_debian>error out == guile: uncaught throw to wrong-type-arg: (#f Wrong type to apply: ~S (#<syntax-transformer add-to-load-path>) (#<syntax-transformer add-to-load-path>))
<daviid>dsmith-work: wrt srfi-115, don't think it is in guildhall, just upgraded and checked [ using the - shift-reset: http://shift-reset.com/doro repo ] what repo do you sue ?
<daviid>s/sue/use :)
***michel_mno is now known as michel_mno_afk
<dsmith-work>daviid: I've never actually useed a guildhall
<dsmith-work>daviid: I just remeber hearing rumors (in here) that irregex was available
<daviid>ok
<paron_remote>hello, *
<paron_remote>does anyone find they want to strip out the keyword arguments out of the #:rest parameter
<paron_remote>and how do you go about doing it? :)
<mark_weaver>how about this: (define (remove-keyword-arguments xs) (match xs (((? keyword? key) value . rest) (remove-keyword-arguments rest)) (_ xs)))
<mark_weaver>this uses (ice-9 match)
<daviid>paron_remote: you could also use (ice-9 optargs), see let-keywords... 6.10.4.2 (ice-9 optargs)
<paron_remote>mark_weaver: thanks :)
<paron_remote>daviid: thanks also :)
<paron_remote>didn't work verbatim, but http://pamrel.lu/eba59/ worked!
<paron_remote>mark_weaver:
<paron_remote>thanks, that helped me figure it out :)
<mark_weaver>paron_remote: I tested what I wrote
<paron_remote>mark_weaver: hm, I wonder why I did wrong
<mark_weaver>ah, interesting
<paron_remote>scheme@(guile-user)> (remove-keyword-arguments '(1 a #:foo 33 #:bar blah nooo))
<paron_remote>$19 = (1 a #:foo 33 #:bar blah nooo)
<paron_remote>was what I got with yours
<paron_remote>scheme@(guile-user)> (remove-keyword-arguments '(1 a #:foo 33 #:bar blah nooo))
<paron_remote>$18 = (1 a blah nooo)
<mark_weaver>right, I intentionally looked for keyword arguments only at the beginning of the rest list, but I guess that's not what you wanted. fair enough :)
<paron_remote>was what I got with the version I put above, which was more what I expected
<paron_remote>mark_weaver: :)
<mark_weaver>but I think you should pass just 'rest', not (cdr rest) in the recursive call
<mark_weaver>and the 'null?' case can be incorporated into the 'match'
<mark_weaver>and the match allows you to avoid 'car' and 'cdr' in the final case
<mark_weaver>(define (remove-keyword-arguments xs) (match xs (((? keyword? key) value . rest) (remove-keyword-arguments rest)) ((x . rest) (cons x (remove-keyword-arguments rest))) (() '())))
<mark_weaver>paron_remote: shouldn't 'blah' have been removed from the list?
<mark_weaver>it is the value associated with #:bar
<mark_weaver>that bug is caused by your use of (cdr rest) in the first recursive call
<paron_remote>mark_weaver: oh
<paron_remote>mark_weaver: you are right :)
<ArneBab>mark_weaver: is there a way to make Guile simplify equations as much as possible before reducing the exactness of numbers?
<ArneBab>something with which (/ pi pi) could give 1
<mark_weaver>ArneBab: no
<mark_weaver>there are various ways you could accomplish that, which would involve adding new numeric representations
*paron_remote sitting next to tim berners-lee
<ArneBab>could it be done with a macro? (simplify (/ pi pi)) → 1
<paron_remote>he talks a million miles a minute
<mark_weaver>but if you're looking for simplification of symbolic expressions, updating the Scmutils port to Guile for Guile 2 would probably be a good step
<mark_weaver>ArneBab: what are you trying to do?
<ArneBab>I’m just looking for an answer to a comment on Stack Overflow :)
<ArneBab>do you mean this? http://www.cs.rochester.edu/~gildea/guile-scmutils/
<mark_weaver>ArneBab: yes
<mark_weaver>oh, it's already done!
*ArneBab thanks Dr. Google for the finding ☺
<mark_weaver>when I last checked, it hadn't yet been updated to Guile 2
<mark_weaver>oooh, and a Imaxima-based mode, nice!
<mark_weaver>(Imaxima is an Emacs mode for Maxima that can display inline graphics, e.g. renderings of TeX-rendered equations and graphics from GnuPlot)
<davexunit>I wish people would post about these releases on guile-user
<davexunit>neat stuff
<mark_weaver>it could easily be adapted to include other inline graphics, e.g. images rendered by guile-cairo
<mark_weaver>guile-charting, etc
<ArneBab>mark_weaver: that’s the answer for which I did asked: http://stackoverflow.com/questions/588004/is-floating-point-math-broken/27030789?noredirect=1#comment46489739_27030789
<ota>ArneBab +1
<ota>Ah, I see cky here too. No surprise I suppose.
<ArneBab>:)
<ArneBab>from the LICENSE, scmutils are GPLv3 or later, so I guess they cannot be integrated into guile…
<berndj>is scm_to_utf8_string a real interface that's just not mentioned in guile.info, or is it a "secret" interface that leaks out?
<ijp>I suspect the former, but don't quote me on it
<sneek>Welcome back ijp, you have 1 message.
<sneek>ijp, nalaginrut says: how about your scm2js project? ;-)
<ijp>berndj: actually, I see it in my info file
<ijp>(info "(guile) Conversion to/from C")
<ijp>oh wait, that says 'from' not 'to'