i have this strange error, related with SRFI 105 (infix curly expression) i admit but the error comes from Racket language not the SRFI 105 reader.
In this macro (i quoted the body for debug) :
(define-syntax $bracket-apply$
(syntax-rules ()
((_ container index)
(cond ((vector? container) '(if (equal? (quote :) (quote index))
container ;; return the vector
(vector-ref container index))) ;; return an element of the vector
((hash-table? container) (hash-table-ref container index))
((string? container) (string-ref container index))
(else (array-ref container index))))
and when testing i got this error:
Welcome to DrRacket, version 8.9 [cs].
Language: reader "../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/SRFI/SRFI-105-toplevel.rkt", with debugging; memory limit: 8192 MB.
> {z <+ #(1 2 3 4 5)}
'#(1 2 3 4 5)
> {z[2]}
'(if (equal? ': '2) z (vector-ref z 2))
> {z[:]}
:: illegal use of syntax
value at phase 1: #<generator> in: :
> (define (:) 7)
> (:)
7
> '{z[:]}
'($bracket-apply$ z :)
> ($bracket-apply$ z :)
'(if (equal? ': ':) z (vector-ref z :))
you will notice there is no error if i use prefix syntax ,error is only when the reader SRFI 105 is used in {z[:]} , error is related with colon : but does not come from reader itself, : does not seems to be a reserved character in Racket.
I do not understand, so any help is greatly appreciated...
i tried to remove the toplevel behavior with removing racket/load and using racket but it change nothing, perheaps the concernis with (require syntax/strip-context)
I think what's happening is that : is already bound to an identifier that is a syntax error when used by itself. But it's hard to tell without being able to run your programs.