***petercommand is now known as Guest57381
***Guest57381 is now known as petercommand
<ijp>greetings earthlings <nalaginrut>do we have function to convert string into BCD? or hex2bin which convert hex in string to binary code? <ijp>I keep functions for converting hex-strings to bytevectors in my (ijputils bytevectors) module, but they depend on foof loop....BCD I have never needed <ijp>I wasn't aware it was still used, but wikipedia assures me it is <ArneBab>can I quiet the auto-compile messages from guile? <civodul>ArneBab: no, this is a long awaited feature :-/ <ArneBab>civodul: oh, ok - thanks for your answer! <ArneBab>civodul: then I’ll just fudge it in my bootstrap script for the time being with a bit of sed and 2>&1… <civodul>yeah, or pre-compile and then use --no-auto-compile <ArneBab>but the pre-compile is what I want to quiet ☺ <ArneBab>${guile} -L . -s language/wisp/spec.scm 2>&1 | sed "s/;;;.*//" | grep . 1>&2 <ArneBab>shorter: guile spec.scm 2>&1 | sed "s/;;;.*//" | grep . 1>&2 <ArneBab>this has the disadvantage, though, of merging stderr and stdout into stderr <ArneBab>real silence: guile example.scm 2>&1 | sed "s/;;;.*//" 2>&1 | grep . 1>&2 ; test ! $$? -eq 0 # grep did not find anything <ArneBab>this gives an error-code when there is output. <ArneBab>nalaginrut: that would be safer, yes *ArneBab felt a bit strange writing the commit message “safer sed thanks to nalaginrut” ☺ <ijp>ArneBab: you can try using -e '(current-warning-port (%make-void-port "w"))' <janneke>what is good way to create/type a homogeneous list? <janneke>the best i can come up with right now is something like: <janneke>(define-class <compound> (<statement>) statements) <janneke>(define-method (add (o <compound>) (s <statement>)) <janneke> (slot-set! o 'statements (append (slot-ref o 'statements) (list s)))) <janneke>(and then of course, hiding slot access etc) hmm? <SmurfettePrincip>janneke, you can use r6rs records and a protocol that requires a certain type. <ijp>SmurfettePrincip: which amounts to the same thing <ijp>I suppose it's a little better because r6rs records aren't as introspective as clos <ijp>janneke: you might not want to append to the end if you are going to do it a lot <janneke>that's new for me, could be just right <janneke>i'm going to check it out, thanks (also for the append clue bat! :-) <SmurfettePrincip>It should probably also verify that type is a procedure come to think of it <janneke>untested is already a big step better than generic documentation :-) <SmurfettePrincip>Well, the "protocol" part of r6rs records can be a bit complex, but how you should see it is that the protocol should be a function which takes as its single argument the normal basic record constructor and returns as function the new one. <janneke>what are the semantics of these scary square brackest for lists? *janneke really needs to read more documentation <SmurfettePrincip>So if you say want to make rational numbers as a record your protocol would be something like [lambda [make] [lambda [x y] [assert (integer? x)] [assert (integer? y)] [assert (not (zero? y))] (make x y)]] <SmurfettePrincip>janneke, they are completely identical to round ones and are purely for easy reading. <SmurfettePrincip>Fields can also be like [fields [mutable x] y] in which case x is mutable and the binding record-x-set! is also made available <SmurfettePrincip>But if you do that, somewhere, at some place, a Dutch crude cartoon figure dies of course. <janneke>ah yes, this rational example is very gentle <SmurfettePrincip>janneke, you can actually choose the names of these procedures like make-homo-list etc, these are just the default forms, the syntax is quite flexible in that. <janneke>i now already have some output: hello world <janneke>string-list: #<r6rs:record:homo-list-of-type>, HEAD, () <janneke>and stuff like (define make-string-list (make-homo-list string?)) <janneke>(define* ((make-homo-list type?) car :optional (cdr '())) <janneke> (make-homo-list-of-type car cdr type?))