Re: Fwd: new function

2021-09-22 Thread Taylan Kammer
On 21.09.2021 21:03, Maxime Devos wrote: > > (define (foo2 set?) > (define x) ; define an (undefined or unbound, not sure about terminology) > variable > (if set? > (let () > (set! x 2) ; change the value of x > (display "x=") > (display x) > (newline)) >

Re: Fwd: new function

2021-09-22 Thread Maxime Devos
Damien Mattei schreef op wo 22-09-2021 om 09:52 [+0200]: > i do not understand well what you want to mean with those example. > For me define-once does not seems to be a solution, it act as define too > much > ,does not set! variable if already exist and can not use to set it again > because, >

Re: Fwd: new function

2021-09-22 Thread Damien Mattei
i do not understand well what you want to mean with those example. For me define-once does not seems to be a solution, it act as define too much ,does not set! variable if already exist and can not use to set it again because, as define it is forbidden twice in the same block for the same variable

Re: Fwd: new function

2021-09-21 Thread Maxime Devos
Damien Mattei schreef op di 21-09-2021 om 15:04 [+0200]: > i have tested define-once > http://www.gnu.org/software/guile/docs/master/guile.html/Top-Level.html > (the defvar of Lisp)and idea are: > -unfortunately it is considered by scheme as a define,so there is some > context where it is not allow

Re: Fwd: new function

2021-09-21 Thread Damien Mattei
i have tested define-once http://www.gnu.org/software/guile/docs/master/guile.html/Top-Level.html (the defvar of Lisp)and idea are: -unfortunately it is considered by scheme as a define,so there is some context where it is not allowed in my code -seems to work fine at toplevel (as mentioned in doc)

Re: Fwd: new function

2021-09-19 Thread Maxime Devos
Matt Wette schreef op zo 19-09-2021 om 07:45 [-0700]: > On 9/19/21 3:38 AM, Maxime Devos wrote: > > [...] > > (use-modules (system syntax)) > > (define-syntax define-or-set! > >(lambda (s) > > (syntax-case s () > >((_ var value) > > (case (syntax-local-binding #'var) > >

Re: Fwd: new function

2021-09-19 Thread Matt Wette
On 9/19/21 3:38 AM, Maxime Devos wrote: Damien Mattei schreef op zo 19-09-2021 om 11:18 [+0200]: -- Forwarded message - From: Damien Mattei Date: Sun, Sep 19, 2021 at 9:54 AM Subject: new function To: hello, i'm developing an extension to Scheme and i need a procedure or m

Re: Fwd: new function

2021-09-19 Thread Maxime Devos
Damien Mattei schreef op zo 19-09-2021 om 11:18 [+0200]: > -- Forwarded message - > From: Damien Mattei > Date: Sun, Sep 19, 2021 at 9:54 AM > Subject: new function > To: > > > hello, > i'm developing an extension to Scheme > and i need a procedure or macro that define a variabl

Fwd: new function

2021-09-19 Thread Damien Mattei
-- Forwarded message - From: Damien Mattei Date: Sun, Sep 19, 2021 at 9:54 AM Subject: new function To: hello, i'm developing an extension to Scheme and i need a procedure or macro that define a variable only if it is not bind and if it is just set! it. I can not do it in Guile