hello,
i have a hard question , not even sure it can be done, i parse some superscript character and create variable from the token i get with this code:
(datum->syntax #'superscript-parser (string->symbol p-tok))
all works well at REPL, but in some code below i got an error:
the problem is that the variable z which should be only one are in fact from 2 modules ,the REPL and the other from the parser, i do not know how i can fix this easily. (it is in syntax transformer context, i have plan to port code parsing completely outside macro expansion, this would solve those problems and allow 100% Qi compatibility that made its own parsing too)
z should be from this "lexical scope" highlighted below:
note if i define z , not like {z <- 1.13+1.765i}
but (define z 1.13+1.765i)
the problem is the same, i just defined it in infix to show the syntax location.
the more fun is that if wrote this code it works:
#lang reader SRFI-105 ; SRFI-105 Curly-infix-expressions
(module repl racket
(provide (all-defined-out))
(require Scheme+)
;; put your code here or simply use the REPL
{z <- 1.13+1.765i}
(define n 2)
;;{n ᶻ}
;;{n ** z}
{n ¹⸱¹³⁺¹⸱⁷⁶⁵ᶦ}
)
0.7450965706579622+2.057849829037449i
because the complex number ¹⸱¹³⁺¹⸱⁷⁶⁵ᶦ
is well parsed and as it is a numerical constant its value is independant of the environment or source location it belongs from.