IRC channel logs

2013-08-05.log

back to list of logs

<nalaginrut>morning guilers~
<davexunit>morning
<nalaginrut>mark_weaver: seems et-record-type-printer! won't enable automatically? I set the printer with proper proc
<nalaginrut>but it print the old style
<nalaginrut>set-record-type-printer!
<mark_weaver>set-record-type-printer! has always worked for me.
<mark_weaver>nalaginrut: can you demonstrate the problem you're seeing with a simple self-contained example?
<mark_weaver>nalaginrut: what you're seeing might be caused by redefining the record type.
<nalaginrut> (set-record-type-printer! <mfd> (lambda (record port) (write-char #\\[ port) (display (mfd-name record) port) (write-char #\\] port)))
<nalaginrut>$104 = #<procedure 46072c0 at <current input>:143:0 (record port)>
<nalaginrut>for an instance
<mark_weaver>nalaginrut: for example, if you create an object A of type <foo>, and then redefine <foo> (by re-evaluating its record type definition), then object A will not be of the same type as the new <foo>
<nalaginrut>but next time I run a certain <mfd> instance, it print the old style
<nalaginrut>so I have to put the print setter before the definition of <foo>?
<mark_weaver>no, you need to avoid redefining <foo> within a guile session.
<mark_weaver>or at least keep in mind that every time you redefine it, you are creating a fresh new type which is distinct from the old one.
<mark_weaver>and that objects created before will be of the old type.
<mark_weaver>actually, GOOPS allows you to redefine a class, and have all the existing instances be converted to the new class automatically.
<mark_weaver>but simple records aren't like that. every time you evaluate the record type definition, you are creating a fresh new type, even if it's structurally the same. just like (cons 1 2) makes a fresh pair each time its run, even though they all print out as (1 . 2)
<mark_weaver>I don't know of this is what's causing your problem, but it's something to keep in mind.
<mark_weaver>s/of/if/
<nalaginrut>so I should define record first then set the printer
<nalaginrut>mark_weaver: it' OK now
<nalaginrut>maybe we have some strange bugs in REPL...
<nalaginrut>especially when reloading modules, but I can't reproduce that again
<nalaginrut>Artanis support multipart/data-form now, it's easy to upload
<nalaginrut>form-data
<nalaginrut>is there any GNU official filesystem? (maybe a bad question here)
<ArneBab_>nalaginrut: not that I know - the Hurd uses an adapted ext2
<nalaginrut>thanks!
<ArneBab_>:)
*ArneBab_ likes calling upon fringe knowledge ;)
<nalaginrut>ArneBab_: well, I saw you in hurd channel ;-)
<ArneBab_>:)
<ArneBab_>nalaginrut: I did most of the month-of-the-hurd newsitems (and I’ll try to get another one published once this years GSoC is finished)
<nalaginrut>hah, it's good
<nalaginrut>could you point out that is MIG a kind of language? if so, where can I find the grammar (better BNF)
<ArneBab_>something like this? www.gnu.org/s/mig/
<nalaginrut>I read it, but didn't get clear
<nalaginrut>;-P
<ArneBab_>what exactly do you need?
<nalaginrut>if it's a language, I think it'd better to rewrite with Guile
<ArneBab_>you could just ask braunr (for example). He might be willing to help if you pledge to update the wiki-page :)
<nalaginrut>I want to make other GNU stuff uses Guile
<nalaginrut>OK, is he a right guy to ask ;-P?
<ArneBab_>The most useful step for that would be full guile bindings for the Hurd, I think. Now that the Hurd libraries use pthreads, you might be able to leverage the commonlisp framework for that
<ArneBab_>nalaginrut: I see braunr as the definite expert on the GNU mach kernel
<nalaginrut>OK thanks
<nalaginrut>Hurd has too many dirs that I didn't get a head
<ArneBab_>nalaginrut: the commonlisp framework for hacking the hurd is here : http://darnassus.sceen.net/~hurd-web/user/flaviocruz/
<ArneBab_>nalaginrut: it would be great to have that for guile, too.
<ArneBab_>nalaginrut: essentially one of the key strengths of the Hurd is that it enables every user to do low-level hacking via translators. So it would be great if we were able to use guile for that.
<nalaginrut>yes, that's why I want to do that ;-)
<ArneBab_>cool!
<ArneBab_>the right way™ to do that is writing a guile interface to the Hurd libraries.
<ArneBab_>we do not need to replace existing, tested code with new code just for the sake of using a different language. But allowing users to write extensions in another language is something entirely different.
<nalaginrut>hmm...seems the master is blank/
<nalaginrut>ArneBab_: no, I don't mean to change MIG to Scheme, since Guile is a mult-lang platform, maybe it's better write a front-end for it
<nalaginrut>if it's a language though
<ArneBab_>MIG is a language, but it’s not what you normally use to extend the Hurd
<ltsampros>Hello,
<ltsampros>system/vm/trace.scm module, is the one provided by the REPL when invoking ,trace (foo)?
***sneek_ is now known as sneek
<amirouche>héllo guilers
<amirouche>I created created a script to count vowels using tail recursion
<amirouche>here is the code https://github.com/amirouche/1001-Projects/blob/scheme/guile/text/count-vowels/count-vowels.scm
<amirouche>isn't count-vowels a candidate to be a lambda inside count-vowels ?
<amirouche>should I use a lambda or a define if I want to define the recursive function inside count-vowels
<amirouche>I fixed the jump to def by adding the directory of the project to load path :)
<amirouche>b
<amirouche>oops
<taylanub>amirouche: I think the most typical way to do that would be with named-let.
<amirouche>ok i look into that
<taylanub>ltsampros: You can see the definitions of REPL meta-commands in module/system/repl/command.scm
<amirouche>so guile read a file as if it was a guile file, isn't it ?
<taylanub>amirouche: Hrm ? Do you mean the `read' procedure ? That reads an s-expression.
<amirouche>yes
<amirouche>there is something else than the read procedure ?
<taylanub>A Guile s-expression. Every Lisp implementation uses slightly different s-expressions ...
<taylanub>You can just read a bytestream.
<taylanub>If not working with data that has s-expression representation.
<amirouche>and then how do I convert it into the proper string ?
<amirouche>I mean, If I read a file as a bytestream, I have to convert it to a utf-8 string
<amirouche>isn't it ?
<taylanub>Pretty sure the documentation tells how to, if you want to read a UTF-8 string.
<dsmith-work>amirouche: There are many read-* procedure. You can read a line, until a delimter, a single char, etc.
<dsmith-work> http://www.gnu.org/software/guile/manual/html_node/Line_002fDelimited.html
<dsmith-work> http://www.gnu.org/software/guile/manual/html_node/rnrs-io-simple.html
<amirouche>thx I missed this links
<taylanub>amirouche: It's advisable to learn how to use Info (C-h i) in Emacs if you haven't already. :)
<amirouche>I don't have guile documentation in emacs AFAIK
<taylanub>If Guile is installed right and your pathes are set right, it should be there.
<taylanub>C-h i d m guile RET
<amirouche>indeed there seem to be a problem regarding this in guix
<amirouche>at least in my installation
<dsmith-work>amirouche: Aww.
<amirouche>got it working :)
***janneke1 is now known as janneke
<dsmith-work>Yey