Re: Help needed debugging segfault with Guile 1.8.7

2010-12-01 Thread Peter TB Brett
Linas Vepstas writes: > Basically, if you are going to let users enter arbitrary scheme into > your app, they *will* enter malformed, broken expressions, and you > have to deal with these. Among other things, you have to give them > a clue as to what the error was -- some sort of trace, error re

Re: Help needed debugging segfault with Guile 1.8.7

2010-12-01 Thread Peter TB Brett
Neil Jerram writes: > [snip] > > I think your design is similar to what is outlined in the `Extending > Dia' node of the Guile manual. Were you aware of that doc before > working out your design? If not, I guess we need to make it more > prominent. If yes, I'd appreciate any suggestions you ha

fluid-let?

2010-12-01 Thread Marek Kubica
Hi, Is there a way to get fluid-let for Guile? Or something like ? I am having a mutable hash object that I don't want to pass as an argument to every single function that I call, I'd prefer to use a similar solution to what t

Re: fluid-let?

2010-12-01 Thread Ludovic Courtès
Hi, Marek Kubica writes: > Is there a way to get fluid-let for Guile? Or something like > ? Guile has fluids and ‘with-fluids’, which is similar to what you want (info "(guile) Fluids and Dynamic States"). It also has SRFI-

Re: Help needed debugging segfault with Guile 1.8.7

2010-12-01 Thread Ludovic Courtès
Hello, Peter TB Brett writes: > Thanks for the info. Judging by previous experience, gEDA will need to > support Guile 1.8.x for at least two years after Guile 2.x arrives. > It's probably going to be painful. :-/ Out of curiosity, did you try building/running gEDA with Guile 1.9.x, the pre-re

List functions

2010-12-01 Thread Hans Aberg
I am writing on a parser that translates normal function syntax in to Guile code. It seems natural to translate (f, g) x into ((f g) x), and () x into (() x), but I'm not sure if the lists (f g) and () can be made acting as functions this way. So what would be natural here? (Constants might

Re: List functions

2010-12-01 Thread Joel James Adamson
Hans Aberg writes: > It seems natural to translate (f, g) x into ((f g) x), and () x into > (() x), but I'm not sure if the lists (f g) and () can be made acting > as functions this way. (f g) would evaluate as a composition as long as f takes a procedure as an argument and returns a function th

Re: List functions

2010-12-01 Thread Hans Aberg
On 1 Dec 2010, at 18:35, Joel James Adamson wrote: It seems natural to translate (f, g) x into ((f g) x), and () x into (() x), but I'm not sure if the lists (f g) and () can be made acting as functions this way. (f g) would evaluate as a composition as long as f takes a procedure as an arg

Re: List functions

2010-12-01 Thread Keith Wright
> From: Hans Aberg > Cc: guile-user@gnu.org > > On 1 Dec 2010, at 18:35, Joel James Adamson wrote: > > >> I am writing on a parser that translates normal > >> function syntax in to Guile code. > >> > >> It seems natural to translate (f, g) x into ((f g) x), If "(f, g) x" is (in normal syntax)

Re: List functions

2010-12-01 Thread Hans Aberg
On 1 Dec 2010, at 20:20, Keith Wright wrote: ... in standard syntax would be natural to let (f, g)(x) evaluate to (f(x), g(x)), producing a list of two elements. In Guile, that would be something involving "map". If I try in Haskell, I can let (sin, cos)(2) be the same as map (g 2) [sin, cos]

Re: List functions

2010-12-01 Thread Andy Wingo
Hi Hans, On Wed 01 Dec 2010 17:28, Hans Aberg writes: > () x into (() x) What is the meaning of this? Did you mean () x into (map (lambda (f) (f x)) '()) ? Regards, Andy -- http://wingolog.org/

Re: List functions

2010-12-01 Thread Hans Aberg
On 1 Dec 2010, at 20:51, Andy Wingo wrote: () x into (() x) What is the meaning of this? Did you mean () x into (map (lambda (f) (f x)) '()) ? I am trying to eliminate the "\" of the Haskell binding syntax \ ... - > f, by making the parser grammar rule for ... the same as evaluation

Re: Help needed debugging segfault with Guile 1.8.7

2010-12-01 Thread Andy Wingo
On Tue 30 Nov 2010 20:56, Peter TB Brett writes: > - An easily re-usable/embeddable and well-documented REPL, to aid >developers in implementing a "Scheme Interaction Window" or similar >in their apps. This is surprisingly difficult to do. A traditional REPL is the bottom of the main lo

Re: List functions

2010-12-01 Thread Hans Aberg
On 1 Dec 2010, at 20:50, Hans Aberg wrote: ... in standard syntax would be natural to let (f, g)(x) evaluate to (f(x), g(x)), producing a list of two elements. In Guile, that would be something involving "map". If I try in Haskell, I can let (sin, cos)(2) be the same as map (g 2) [sin, cos] whe

Re: Generating compiled scm (.go) files as part of LilyPond build

2010-12-01 Thread Ian Hulin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Andy, On 29/11/10 21:17, Andy Wingo wrote: > On Sat 27 Nov 2010 18:42, Ian Hulin writes: > >> Our long-term aim, when we are able to move to using Guile V2.0 as an >> infrastructure, is to byte-compile as many of these as possible during >> the Li

Re: List functions

2010-12-01 Thread Keith Wright
> Cc: adams...@email.unc.edu, guile-user@gnu.org > From: Hans Aberg > > I was trying variations like >(let () > (define (g x)(lambda (f)(f x))) > (map (g 2) '(sin cos))) > Which gives an error: >In expression (f x): >Wrong type to apply: sin Somebody should patc

Re: Generating compiled scm (.go) files as part of LilyPond build

2010-12-01 Thread Andy Wingo
On Wed 01 Dec 2010 22:21, Ian Hulin writes: > i...@greebo$ guile-tools compile scm/lily-library.scm > wrote > `/home/ian/.cache/guile/ccache/2.0-0.S-LE-4/home/ian/lilypond/scm/lily-library.scm.go' You will want to set the -o option, as in GCC. See guile-tools compile --help. Cheers, Andy -- h

Re: List functions

2010-12-01 Thread Hans Aberg
On 1 Dec 2010, at 22:34, Keith Wright wrote: On the other hand |list| is an ordinary variable so, (list sin cos) is evaluated by evaluating the three subexpressions, giving a function that makes lists and two numeric functions of a numeric vaiable, and then applying the first function, i.e. list

Re: List functions

2010-12-01 Thread Hans Aberg
On 1 Dec 2010, at 22:34, Keith Wright wrote: I was trying variations like (let () (define (g x)(lambda (f)(f x))) (map (g 2) '(sin cos))) Which gives an error: In expression (f x): Wrong type to apply: sin Somebody should patch that so that it mentions the wrong type. it

Re: fluid-let?

2010-12-01 Thread Marek Kubica
Hi, On Wed, 01 Dec 2010 14:41:30 +0100 l...@gnu.org (Ludovic Courtès) wrote: > > Is there a way to get fluid-let for Guile? Or something like > > ? > > Guile has fluids and ‘with-fluids’, which is similar to what you want > (

Does Guile have a curry form?

2010-12-01 Thread Marek Kubica
Hi, Before I reinvent the wheel, does Guile have support for something similar to Racket's curry/curryr or Pythons functools.partial, which returns me a lambda with some arguments already pre-set? regards, Marek

GOOPS:Can I just overload "slot-set!" under #:virtual and let alone "slot-ref" ?

2010-12-01 Thread Nala Ginrut
Hi, everybody! I got a question while I'm trying GOOPS, here is some example code pieces: ;;guile code (define-class () (cache #:init-form 0) (tt #:init-form 1 #:allocation #:virtual #:slot-set! (lambda (o v) (slot-set! o 'cache