IRC channel logs

2015-05-15.log

back to list of logs

***cluck` is now known as cluck
<zacts>hi guilers
<nalaginrut>morning guilers~
***michel_mno_afk is now known as michel_mno
***michel_mno is now known as michel_mno_afk
***michel_mno_afk is now known as michel_mno
<janneke>i'm trying to write a macro for (make ...), how do I get rid of this eval?
<janneke>(define-syntax-rule (make type args ...)
<janneke> ((eval (symbol-append 'make '- type) (current-module)) args ...))
<janneke>
<janneke>(make <interface>) should simply run (make-<interface>)
<civodul>Hello Guilers!
<civodul>janneke: one problem is that this macro generates an identifiers that is not in the source
<civodul>if you really want to do that though, syntax-case permits it
<janneke>civodul: I have (define (make-<interface> . args) ...)
<civodul>(define-syntax make (lambda (s) (syntax-case s () ((_ type args ...) (with-syntax ((m (datum->syntax #'type (symbol-append 'make- (syntax->datum #'type))))) #'(m args ...))))))
<janneke>civodul: wow, thanks!
<civodul>but really, such "unhygienic" macros are usually considered Bad Practice :-P
<janneke>civodul: ah...
*janneke should learn about that...
<civodul>janneke: see http://www.gnu.org/software/guile/manual/html_node/Syntax-Rules.html#Hygiene
<janneke>civodul: thanks!
<janneke>so it would be cleaner to not define separate make-<interface> etc functions
<janneke>but have one (define (make-ast type) (match type ('<interface> ...))) or something?
<civodul>probably, or just have people type (make-foo ...) instead of (make foo ...)
*wingo doesn't mind deriving identifiers from other identifiers
<wingo>macros that derive identifiers are still well-specified and preserve many of the useful aspects of "hygiene"
<civodul>wingo: yes, right
<civodul>i think in this case it may be best to avoid deriving identifiers though
<civodul>there's less of an incentive than for record-definition macros, it seems
***aksatac is now known as cataska
<davexunit>ooh new "the little ..." book: https://mitpress.mit.edu/books/little-prover
<dsmith-work>Happy Friday, Guilers!!
<ijp>wingo: ryan culpepper coined the term "morally hygienic" for them
***michel_mno is now known as michel_mno_afk
<wingo>haha
<linas>So -- any suggestions on crash debugging with guile?
<linas>I can't quite get either valgrind or electric fence to work
<linas>I'm seeing what looks like a heap address written to the middle of a guile stack trace
<linas>probably due to my C code ...
<linas>Oh, I take that back. I see what looks like a stray 32-bit address in the middle of a guile stack trace, but my system is 64-bit,
<linas>so 4 garbled bytes don't make sense.
<linas>0x b0 12 0c 01 or little-endian 0x010c12b0 -- are these guile byte-codes?
<linas>ascii #vu8(176 18 12 1)