[PATCH] object->string should return obj immediately while obj is a string

2012-07-03 Thread Nala Ginrut
hi guys! I realized that our object->string will do some unnecessary works for a string object. --code-- (object->string "\n") ==> "\\n" ---end-- It's illogical! I get several errors when I'm reading xml files. It generates too many "\\" that I must

Re: A vm for native code in guile

2012-07-03 Thread Stefan Israelsson Tampe
On Tue, Jul 3, 2012 at 12:16 AM, Andy Wingo wrote: > On Mon 02 Jul 2012 09:53, Stefan Israelsson Tampe > writes: > > > Anyway I can now compile simple functions to native sequences of machine > code but with some > > tools around it so let me explain the setup. > > Where is this code? Sorry for

Re: Enhancement to the syntax system?

2012-07-03 Thread Stefan Israelsson Tampe
On Tue, Jul 3, 2012 at 12:41 AM, Ludovic Courtès wrote: > Hey! > > Stefan Israelsson Tampe skribis: > > > Maybe this help to see what I'm after, > > > > #'(let ((x v)) #.(f #'x)) > > > > <=> > > > > (let-syntax ((g (lambda (stx) (syntax-case stx ((_ x) (f #'x) > >#'(let ((x v)) (g x)) >

Re: [PATCH] object->string should return obj immediately while obj is a string

2012-07-03 Thread Krister Svanlund
Shouldn't the function return a string representing the object.rather than the object itself, even for a string. It should be up to your application to handle if it's a string imho. On Jul 3, 2012 2:42 PM, "Nala Ginrut" wrote: > hi guys! > I realized that our object->string will do some unnecessa

Re: [PATCH] object->string should return obj immediately while obj is a string

2012-07-03 Thread dsmich
Krister Svanlund wrote: > Shouldn't the function return a string representing the object.rather than > the object itself, even for a string. It should be up to your application > to handle if it's a string imho. > On Jul 3, 2012 2:42 PM, "Nala Ginrut" wrote: > > > hi guys! > > I realized

Re: Enhancement to the syntax system?

2012-07-03 Thread Ludovic Courtès
Hey! Stefan Israelsson Tampe skribis: >> Stefan Israelsson Tampe skribis: >> >> > Maybe this help to see what I'm after, >> > >> > #'(let ((x v)) #.(f #'x)) >> > >> > <=> >> > >> > (let-syntax ((g (lambda (stx) (syntax-case stx ((_ x) (f #'x) >> >#'(let ((x v)) (g x)) [...] > If you

Re: scm_to_pointer vs scm->pointer

2012-07-03 Thread Ludovic Courtès
Heya! Andy Wingo skribis: > scm->pointer takes a Scheme value and returns a Scheme value which is a > foreign pointer to the Scheme value. It has been in Guile since 2.0 I > think. v2.0.0-105-g148c331, apparently. > scm_to_pointer takes a Scheme value which is a foreign pointer, and > unpacks

Re: Enhancement to the syntax system?

2012-07-03 Thread Stefan Israelsson Tampe
You do not need gensyms if you try to mimic or implement my suggested #. . On the other hand when if you do this (define (f stx) #`(let ((x 1)) #,stx)) and use this with #`(let ((x 2)) #,(f #'x)) the resulting expanded code would produce 1 which is not what you want. So in the racket matcher I

Re: [PATCH] object->string should return obj immediately while obj is a string

2012-07-03 Thread Nala Ginrut
@Krister I thought it should be a generic requirement. And dsmich's answer proved it. It should be the duty of this API but the user choose the output policy. @dsmich I confess I didn't read the manual carefully. Thanks for reminding. On Wed, Jul 4, 2012 at 3:34 AM, wrote: > > Krister Svan