Re: local eval

2023-04-27 Thread Damien Mattei
finally i arrive to this solution that works: ;; now quoting all the operators ... so we are no more annoyed with macro 'bad syntax' error and also this keep the 'and and 'or short-circuited functionalities. (define-macro (quote-all . Largs) (if (null? Largs) `(quote ,Largs) `(cons

Re: local eval

2023-04-26 Thread Damien Mattei
hello Mikael, hello Robby, yes my infix evaluator _with_ precedence is more complex than evaluating a single var. What became your macro Mikael in case of an expression? , in my original code ,now, i'm passing all vars quoted, so i need to evaluate the whole expression, because evaluating special

Re: local eval

2023-04-26 Thread Mikael Djurfeldt
(However, I suspect that you didn't *really* mean (quote var) in your original code, or? If you didn't, then of course my simpler syntax-rules macro isn't what you want.) On Wed, Apr 26, 2023 at 7:20 PM Mikael Djurfeldt wrote: > How about: > > (define-syntax eval-var > (syntax-rules () > (

Re: local eval

2023-04-26 Thread Mikael Djurfeldt
How about: (define-syntax eval-var (syntax-rules () ((_ var) var))) ? Then you don't need to import (ice-9 local-eval) and re-export things from there. Just for elucidation: The reason why we chose the syntax-case macro system for Guile was that it *both* gives you hygiene *and* quite a

Re: local eval

2023-04-26 Thread Robby Zambito
Damien Mattei writes: > i can not make it run i always have something unbound , not reach the var i > but local-eval is unbound now? I added this line to the module definition #:re-export (local-eval the-environment) Did you also add that? The way the unhygienic macros work, it essentiall

Re: local eval

2023-04-26 Thread Damien Mattei
i can not make it run i always have something unbound , not reach the var i but local-eval is unbound now? On Mon, Apr 24, 2023 at 6:24 PM Damien Mattei wrote: > thank you, i will try the old macro form. > Damien > > On Mon, Apr 24, 2023 at 4:24 PM Robby Zambito > wrote: > >> >> Whoops I had a

Re: local eval

2023-04-24 Thread Damien Mattei
thank you, i will try the old macro form. Damien On Mon, Apr 24, 2023 at 4:24 PM Robby Zambito wrote: > > Whoops I had a duplicate export from when I was testing with things, but > you get the idea :) >

Re: local eval

2023-04-24 Thread Robby Zambito
Hi Damien The issue you are running into is related to macro hygiene. If you implement eval-var using the non-hygienic define-macro, it works how you want. (define-module (Scheme+) #:use-module (ice-9 local-eval) #:re-export (local-eval the-environment) #:export (eval-var eval-var)) (def