Re: new function

2021-09-23 Thread Damien Mattei
so i drop off the idea of a single assignment operator, there will be 2 ,<- for single assignment when the variable has been previously defined (at upper level), and another <+ that add a variable in the environment using define. Other possibility is to have a single assignment operator <- and to d

Re: new function

2021-09-23 Thread Damien Mattei
yes i'm using GNU Guile 3.0.7, https://www.gnu.org/software/guile/docs/master/guile.html/Syntax-Transformer-Helpers.html i have tested a lot , even define-once again and i choose to use to assignment operators and portable code because the non-portable function do not bring more, finally it was no

Re: new function

2021-09-23 Thread Taylan Kammer
Responding to myself: On 23.09.2021 22:27, Taylan Kammer wrote: > I can't seem to find syntax-local-binding in Guile 2.2 or 3.0. Did you > have to import some special module, or are you using another version? Worked when I imported (system syntax internal). > Either way, I suspect that the fol

Re: new function

2021-09-23 Thread Damien Mattei
yes it can reuse an upper and precedent definition but a nested definition can not be used later at an upper level. anyway it would not be portable , for all those reason i will use to separate operator ,basically <- for set! and <+ for define ,so i can even modify toplevel bindings , i did not wa

Re: new function

2021-09-23 Thread Taylan Kammer
On 23.09.2021 19:27, Damien Mattei wrote: > yes i know parsing the whole code is the only portable solution, but it is > slow,even on a few dozen of lines the slowing is visible ,so i can even think > of that on one thousand lines... > > I finally succeed in Guile with simple piece of code to ma

Re: new function

2021-09-23 Thread Taylan Kammer
On 22.09.2021 23:52, William ML Leslie wrote: > On Thu, 23 Sep 2021, 4:51 am Taylan Kammer, > wrote: > > On 22.09.2021 11:53, Damien Mattei wrote: > > i already do it this way for internal defines ,using a recursive macro > that build a list of variable us

Re: new function

2021-09-23 Thread Maxime Devos
Damien Mattei schreef op do 23-09-2021 om 19:27 [+0200]: > yes i know parsing the whole code is the only portable solution, but it is > slow,even on a few dozen of lines the slowing is visible ,so i can even think > of that on one thousand lines... > > I finally succeed in Guile with simple piec

Re: new function

2021-09-23 Thread Damien Mattei
yes i know parsing the whole code is the only portable solution, but it is slow,even on a few dozen of lines the slowing is visible ,so i can even think of that on one thousand lines... I finally succeed in Guile with simple piece of code to make my example run with a single assignment operator <-

Re: new function

2021-09-23 Thread Damien Mattei
interesting discussion about "scope", note i'm not saying i want Scheme+ act as Python, i'm still thinking the best solution... to be sure about terminology i find this good article about scoping: https://medium.com/altcampus/scope-local-global-and-lexical-e164f53450b3 Damien On Wed, Sep 22, 2021

Re: new function

2021-09-22 Thread William ML Leslie
On Thu, 23 Sep 2021, 4:51 am Taylan Kammer, wrote: > On 22.09.2021 11:53, Damien Mattei wrote: > > i already do it this way for internal defines ,using a recursive macro > that build a list of variable using an accumulator. It can works but macro > expansion seems slow, it was not immediate at co

Re: new function

2021-09-22 Thread Taylan Kammer
On 22.09.2021 11:53, Damien Mattei wrote: > i already do it this way for internal defines ,using a recursive macro that > build a list of variable using an accumulator. It can works but macro > expansion seems slow, it was not immediate at compilation on a little example > (oh nothing more that

Re: new function

2021-09-22 Thread Damien Mattei
i already do it this way for internal defines ,using a recursive macro that build a list of variable using an accumulator. It can works but macro expansion seems slow, it was not immediate at compilation on a little example (oh nothing more that 2 seconds) but i'm not sure it is easily maintainable

Re: new function

2021-09-22 Thread William ML Leslie
You could do it the same way python does it: have `def` be a macro that inspects its body for assignments to symbols, and then let-bind them at the top of the function. On Wed, 22 Sep 2021, 6:45 pm Damien Mattei, wrote: > Hi Taylan, > > i have used Module System Reflection, and it works almost f

Re: new function

2021-09-22 Thread Damien Mattei
Hi Taylan, i have used Module System Reflection, and it works almost for what i wanted to do,the only big problem is that it creates variable binding global, seen from every where and that breaks my example code, by the way i will display for everybody an example of use of such a macro,so everyone

Re: new function

2021-09-21 Thread Damien Mattei
here is the "draft mail" i think it was better to answer separetely,but i send it waiting more... thanks for all the answer, i'm answering in a single answer to all for easyness and because some answers where same First some people don't understand well my goal. It was just to be able to create a

Re: new function

2021-09-19 Thread Taylan Kammer
On 19.09.2021 09:54, Damien Mattei wrote: > 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 or any Scheme,and i'm desperately searching a way to > do that. I f

Re: new function

2021-09-19 Thread Matt Wette
On 9/19/21 7:41 AM, Matt Wette wrote: On 9/19/21 12:54 AM, Damien Mattei wrote: 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 or any Scheme,and i'm desperately s

Re: new function

2021-09-19 Thread Matt Wette
On 9/19/21 12:54 AM, Damien Mattei wrote: 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 or any Scheme,and i'm desperately searching a way to do that. I finally conc