5
I am writing a compiler Scheme R6RS(school work). It is working perfectly with the exception of this standard proposed in the manual 11.19 - Macro Transformes: sintaxe-rules
.
I have read and reread and can not understand how this pattern of ellipses(... ...) can return element 4 of the list (1 2 3 4 )?
Code I can’t understand working:
(define-syntax be-like-begin
(syntax-rules ()
((be-like-begin name)
(define-syntax name
(syntax-rules ()
((name expr (... ...))
(begin expr (... ...))))))))
(be-like-begin sequence)
(display (sequence 1 2 3 4))
The result is:
4
Someone please explain to me why it worked. That’s what I need to close a chapter of my life.
I have tested on some compilers and some do not recognize this pattern, but those who recognize the result is always 4.
– Augusto Vasques
Who negatived could please explain why this question is bad because this question is related to my monograph where I wrote a compiler of SCHEME R6RS language in C# and this expansion pattern is unique that I could not understand and is what prevents me from completing the compiler and here is the link in the official documentation for this expansion standard
– Augusto Vasques
Another great question for https://cs.stackexchange.com
– Piovezan