Re: Understanding `symbol??` macro from okmij.org

2024-03-14 Thread Jean Abou Samra
> Ah, and I though that syntax-rules was always written in term of > syntax-case. I see. Thank you! Yeah, it most most often is these days, but historically, syntax-rules was invented before syntax-case. IIRC, the choice to include syntax-case in R6RS was controversial because syntax-rules

Re: Understanding `symbol??` macro from okmij.org

2024-03-14 Thread Olivier Dion
On Thu, 14 Mar 2024, Jean Abou Samra wrote: >> Excuse my ignorance, by why is symbol?? not written using syntax-cases >> and the `indentifier?' guard? > > a) Because it's intellectually interesting to see what the power of > syntax-rules is :) > b) Not all Scheme standards and implementations

Re: Understanding `symbol??` macro from okmij.org

2024-03-14 Thread Jean Abou Samra
> Excuse my ignorance, by why is symbol?? not written using syntax-cases > and the `indentifier?' guard? a) Because it's intellectually interesting to see what the power of syntax-rules is :) b) Not all Scheme standards and implementations contain syntax-case.

Re: Understanding `symbol??` macro from okmij.org

2024-03-14 Thread Olivier Dion
Excuse my ignorance, by why is symbol?? not written using syntax-cases and the `indentifier?' guard? On Thu, 14 Mar 2024, Zelphir Kaltstahl wrote: > Hello Guile Users! > > I am having trouble understanding how the `symbol??` macro from > https://okmij.org/ftp/Scheme/assert-syntax-rule.txt

Re: Understanding `symbol??` macro from okmij.org

2024-03-14 Thread Zelphir Kaltstahl
On 3/14/24 02:01, Jean Abou Samra wrote: Hi! The explanations are on https://okmij.org/ftp/Scheme/macros.html#macro-symbol-p Maybe this version will be easier to understand (we don't really need continuation-passing style here): (define-syntax symbol?? (syntax-rules () ((symbol??

RE: Understanding `symbol??` macro from okmij.org

2024-03-13 Thread Maxime Devos
(define-syntax symbol?? (syntax-rules () ;; The check is done by first pattern matching against some other ;; forms, that are not a symbol. ((symbol?? (x . y) kt kf) kf) ; It's a pair, not a symbol ((symbol?? #(x ...) kt kf) kf) ; It's a vector, not a symbol The first two

Re: Understanding `symbol??` macro from okmij.org

2024-03-13 Thread Jean Abou Samra
Hi! The explanations are on https://okmij.org/ftp/Scheme/macros.html#macro-symbol-p Maybe this version will be easier to understand (we don't really need continuation-passing style here): (define-syntax symbol?? (syntax-rules () ((symbol?? maybe-symbol) (let-syntax ((test