Re: Does Guile have a curry form?

2010-12-02 Thread Thien-Thi Nguyen
() Marek Kubica () Thu, 2 Dec 2010 05:45:56 +0100 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? If you mean: (define ((foo x) y) (

Re: List functions

2010-12-02 Thread Hans Aberg
On 2 Dec 2010, at 10:57, Marco Maggi wrote: I am writing on a parser that translates normal function syntax in to Guile code. I do not know which scenario you are working with, ... I have a Bison/Flex parser/lexer combination that writes Guile code directly by calling Guile C-functions,

Re: Does Guile have a curry form?

2010-12-02 Thread Ludovic Courtès
Hi, Marek Kubica writes: > 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? There’s SRFI-26 (info "(guile) SRFI-26"). Thanks, Ludo’.

Re: List functions

2010-12-02 Thread Marco Maggi
"Marco Maggi" wrote: >"Hans Aberg" wrote: >> I am writing on a parser that translates normal function >> syntax in to Guile code. > > I do not know which scenario you are working with, but it > is perfectly possible to convert the input syntax: > > ((sin , cos , tan) 1.2) Sorry, I have been too

Re: List functions

2010-12-02 Thread Marco Maggi
"Hans Aberg" wrote: > I am writing on a parser that translates normal function > syntax in to Guile code. I do not know which scenario you are working with, but it is perfectly possible to convert the input syntax: ((sin , cos , tan) 1.2) to the output: ((lambda args (map (lambda (f)

Re: List functions

2010-12-02 Thread Hans Aberg
Another problem: passing a list of length two to a function that takes two non-arguments. For example, (define h (lambda (x y) (display x) (display y))) and passing (list 1 2) to it. It is in the same context as before: I want to build functions like in Haskell f((1, 2), 3) where f = \((

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

2010-12-02 Thread Neil Jerram
On 2 December 2010 07:06, Nala Ginrut wrote: > 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) >

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

2010-12-02 Thread Nala Ginrut
thanks, but my question is something like this: ... (cache ... #:slot-ref (lambda (o) (slot-ref o 'cache)) ...) ;; ERROR ... (sunday ... #:slot-ref (lambda (o) (slot-ref o 'cache)) ...) ;; That's OK I could call "(slot-ref o 'cache)" in other slot except "cache", but what should I do if I need to

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

2010-12-02 Thread Neil Jerram
On 3 December 2010 00:52, Nala Ginrut wrote: > thanks, but my question is something like this: > ... > (cache ... #:slot-ref (lambda (o) (slot-ref o 'cache)) ...) ;; ERROR > ... > (sunday ... #:slot-ref (lambda (o) (slot-ref o 'cache)) ...) ;; That's OK > > I could call "(slot-ref o 'cache)" in o

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

2010-12-02 Thread Nala Ginrut
yeah~you hit it precisely! But I'm not sure if I modified the slot-seting call ,the result is all slot-set! procedure would be effected? That's terrible. If there isn't any existed solution, I'd better look into the code and do some hacking. Thank you very much!

Re: Help needed debugging segfault with Guile 1.8.7

2010-12-02 Thread Peter TB Brett
l...@gnu.org (Ludovic Courtès) writes: > 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/