Damien Mattei schreef op vr 04-02-2022 om 17:24 [+0100]:
> even with $nfx$ it does not seem to be possible without set!-values:
> https://docs.racket-lang.org/reference/set_.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._set%21-values%29%29
>
> does someone know how to implement
even with $nfx$ it does not seem to be possible without set!-values:
https://docs.racket-lang.org/reference/set_.html#%28form._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._set%21-values%29%29
does someone know how to implement set!-values in Scheme for Guile?
with set!-values things are rea
definitely i do not think it is possible to have a macro doing this:
{(x y z) <- (foo)} ;; foo is a function that return 3 values (ex: (values 1
2 3))
or this :
{(x y z ...) <- (bar)} ;; bar return an arbitrary (known in advance )
number of values
and also have a compatibility with:
{T[2] <- T[1]}
oh :-O yes it is the behavior expected : assign the 2nd element of an array
T with value 1 :
prefix notation of : (<- ($bracket-apply$ T 2) 1) is equivalent in Curly
Infix syntax to : {T[2] <- 1}
as expected when $bracket-apply$ is not bound we have the good result.
Thanks for this result.
Of cours
Hi Damien,
I tried to run the code you provided. I ran
-
(define-syntax <-
(syntax-rules ($bracket-apply$)
((_ ($bracket-apply$ container index) expr)
(let ((value expr)) ;; to avoid compute it twice
(cond ((vector
;> From: Damien Mattei
>> Date: Wed, Feb 2, 2022 at 12:09 PM
>> Subject: Re: reserved-keyword in macro
>> To: Maxime Devos
>>
>>
>> thanks maxim ,it works so my problem come from elsewhere
>>
>> scheme@(guile-user)> (define-syntax macro
>>
ing list...
>
> -- Forwarded message -
> From: Damien Mattei
> Date: Wed, Feb 2, 2022 at 12:09 PM
> Subject: Re: reserved-keyword in macro
> To: Maxime Devos
>
>
> thanks maxim ,it works so my problem come from elsewhere
>
> scheme@(guile-user)>
sorry i miss copy to mailing list...
-- Forwarded message -
From: Damien Mattei
Date: Wed, Feb 2, 2022 at 12:09 PM
Subject: Re: reserved-keyword in macro
To: Maxime Devos
thanks maxim ,it works so my problem come from elsewhere
scheme@(guile-user)> (define-syntax ma
Damien Mattei schreef op wo 02-02-2022 om 11:13 [+0100]:
> (define-syntax macro
> (syntax-rules ()
> ((_ arg1 arg2) code1)
> ((_ reserved-keyword arg) code2)))
The rules are matched in-order, so when the first rule matches, the
second rule is ignored. I suggest:
(define-syntax macro
(syntax-
hello,
what is the best way to use a reserved keyword in a macro (a keyword for me
not already used in scheme):
if i have multiple patterns in a macro,for example:
(define-syntax macro
(syntax-rules ()
((_ arg1 arg2) code1)
((_ reserved-keyword arg) code2)))
now if i call the macro with (macro r
10 matches
Mail list logo