Re: 2 macros in one expression

2023-04-15 Thread Damien Mattei
the same expression in Scheme would be: (set! xp (/ (- x (* v t)) (sqrt (- 1 (/ (expt v 2) (expt c 2)) > xp -1102228130.2405226 a bit less readable than: {xp <- {x - v * t} / (sqrt {1 - v ** 2 / c ** 2})} -1102228130.2405226 or: {xp ← {x - v * t} / (sqrt {1 - v ** 2 / c ** 2})} -1102228130.

Re: 2 macros in one expression

2023-04-15 Thread Damien Mattei
it works pretty well again now the new version is debugged, this code is related to infix evaluation in Scheme+ with operator precedence , here is an example: ;;; compiled /Users/mattei/.cache/guile/ccache/3.0-LE-8-4.6/usr/local/share/guile/site/3.0/Scheme+.scm.go scheme@(guile-user)> { 4 + 3 * 2

Re: 2 macros in one expression

2023-04-15 Thread Damien Mattei
my problem is solved by quoting the variable that CAN store a special form (example: <-) and forcing its evaluation ! : (eval (quote opspecial) (interaction-environment)) here is my 'else clause: (else (! ident (eval (quote opspecial) (current-namespace)) term1 op term2)) for Racket, in Gui

Re: 2 macros in one expression

2023-04-15 Thread Damien Mattei
yes i tried it, i often get this answer :-) with this sort of problem i recurrent have with macros and it never helps ,at the point i never understood what is the use of this option in syntax-rules. My error i think was to forget the expansion stage of macro expansion that is always done for all t

Re: 2 macros in one expression

2023-04-15 Thread Matt Wette
Did you try using the following? (define-syntax $nfx$ (syntax-rules (<-) ((... On 4/14/23 4:02 AM, Damien Mattei wrote: hello, i have 2 macros used in one expression like this: scheme@(guile-user)> (define i 2) scheme@(guile-user)> {i <- i + 1} and i got this error: While compiling expr

Re: 2 macros in one expression

2023-04-15 Thread Damien Mattei
just understood my error: quote is a macro, so it stop the evaluation of the other macro <- and <- is expanded in the else even if this branch will not be executed and the error arise. On Fri, Apr 14, 2023 at 9:36 PM Damien Mattei wrote: > i test my previous problem both with Racket and Guile, i