Re: guile.m4

2006-06-13 Thread Aaron VanDevender
On Wed, 2006-06-14 at 01:17 +0100, Neil Jerram wrote: > > +GUILE_CHECK([GUILE_CORRECT_VERSION_P], > > +[(exit (let loop ((v1 (map string->number (string-split (version) > > (string-ref \".\" 0 > > + (v2 (map string->number (string-split \"$1\" (string-ref > > \".\" 0) > >

Re: guile.m4

2006-06-13 Thread Neil Jerram
Aaron VanDevender <[EMAIL PROTECTED]> writes: > Here is a slightly improved version of my guile.m4 patch. It has some > more explicit comments and uses the guile executable set by GUILE_PROGS Thanks for working on this. I have a couple of queries. > +GUILE_CHECK([GUILE_CORRECT_VERSION_P], > +

Re: values->list elements

2006-06-13 Thread Per Bothner
If you make "multiple values" first-class then you get into an interesting and useful design space. See the XQuery language (http://www.w3.org/XML/Query and http://www.w3.org/TR/xquery/). Its values are "sequences" of "items". The difference between a list and a sequence is that sequences don't

Re: values->list elements

2006-06-13 Thread Jonathan Wilson
Ah... great minds DO think alike! Regards, Jon Neil Jerram wrote: Jon Wilson <[EMAIL PROTECTED]> writes: The intermediate step (after the macro expansion I guess) would look like (+ 1 2) ==> 3 It seems like this would make multiple values much much more useful. I've often thought that too.

Re: values->list elements

2006-06-13 Thread Neil Jerram
Jon Wilson <[EMAIL PROTECTED]> writes: > The intermediate step (after the macro expansion I guess) would look like > > (+ 1 2) > ==> > 3 > > It seems like this would make multiple values much much more useful. I've often thought that too. IMO multiple values per R5RS are a pretty half-baked conc

Re: values->list elements

2006-06-13 Thread Neil Jerram
szgyg <[EMAIL PROTECTED]> writes: > (define-macro (values->list vs) > `(call-with-values (lambda () ,vs) list)) > > (apply + (values->list (values 1 2 3))) Yes, but why does this need to be a macro? (define (values->list vs) (call-with-values (lambda () vs) list)) > or > > (define-macro (

Re: values->list elements

2006-06-13 Thread Jonathan Wilson
Hi szgyg, szgyg wrote: No, this is impossible without redefining +. A macro produces 1 sexp, not more. This is exactly what I am getting at. values does return more than 1 sexp, but the mechanisms for using that are clumsy and painful. It seems that if values returns multiple s-expressions

Re: Newbie question: bind a variable on the fly

2006-06-13 Thread Jonathan Wilson
Hi Neil, Neil Jerram wrote: Jon Wilson <[EMAIL PROTECTED]> writes: (define-macro (dyn-set! var val) `(begin (if (not (defined? (quote ,var))) (primitive-eval `(define ,(quote ,var) #f))) (set! ,var ,val))) (defined? 'undefined-symbol)

Newbie question: bind a variable on the fly

2006-06-13 Thread Vincent De Groote
Hello, Is there a way to catch an "unbound-variable" exception, bind the variable on the fly, and continue execution as if the exception didn't occurs ? I'd like to catch this exception in a c function: the exception context should be available, to retrieve the variable or function name. This h

Re: values->list elements

2006-06-13 Thread szgyg
Jon Wilson wrote: Is there any sensible way to implement the following semantics: (+ (values 1 2)) ==> 3 > Or perhaps with a macro of some sort (but preferably as above)... (+ (values->list-elements (values 1 2))) ==> 3 ! untested code ! (define-macro (values->list vs) `(call-with-value

guile.m4

2006-06-13 Thread Aaron VanDevender
Here is a slightly improved version of my guile.m4 patch. It has some more explicit comments and uses the guile executable set by GUILE_PROGS Index: guile.m4 === RCS file: /sources/guile/guile/guile-core/guile-config/guile.m4,v retrie