The scheme language allows you to use let-syntax and other mechanisms to customize special Syntax structures. The pattern language used to define this syntax structure has an inconspicuous literal identifier, which is the <literals> In the following syntax:
(Syntax-rules <literals> <syntax rule> ...)
The interpretation of literal identifier in scheme standard r5rs is obscure. I wrote a small example based on my own understanding, which can play a complementary role:
; Define the syntax Z when literal identifier is not used
(Define-syntax Z
(Syntax-rules ()
(Z (+ x y ))))
; The result of the following row is 7
(Z (+ 3 4 ))
; The result of the following row is-1, which plays a role in the plus sign after the local change.
(Let (+-) (Z (+ 3 4 )))
; Use literal identifier to define the syntax Z
(Define-syntax Z
(Syntax-rules (+)
(Z (+ x y ))))
; The result of the following row is still 7
(Z (+ 3 4 ))
; The following line returns an error: Z: bad syntax in: (Z (+ 3 4 ))
; The plus signs with different meanings (actually different binding) cannot be applied to the syntax.
(Let (+-) (Z (+ 3 4 )))
With the above example, the complicated example mentioned in r5rs is better understood:
(Define-syntax cond
(Syntax-rules (else =>)
(Cond (else result1 result2 ...))
(Begin result1 result2 ...))
(Cond (test => result ))
(Let (temp test ))
(If temp (result temp ))))
(Cond (test => result) clause1 clause2 ...)
(Let (temp test ))
(If temp
(Result temp)
(Cond clause1 clause2 ...))))
(Cond (TEST) test)
(Cond (TEST) clause1 clause2 ...)
(Let (temp test ))
(If temp
Temp
(Cond clause1 clause2 ...))))
(Cond (test result1 result2 ...))
(If test (begin result1 result2 ...)))
(Cond (test result1 result2 ...)
Clause1 clause2 ...)
(If test
(Begin result1 result2 ...)
(Cond clause1 clause2 ...)))))
Based on the cond definition above, the following code
(Let (=> # F ))
(Cond (# T => 'OK); =) OK
It will be interpreted as (here => is regarded as a variable rather than a syntax element)
(Let (=> # F ))
(If # T (begin => 'OK )))
Instead
(Let (=> # F ))
(Let (temp # t ))
(If temp ('OK temp ))))
Because the local => has changed its meaning, it cannot match the syntax rules that contain =>.