Thanks, I've pushed a fix. Meanwhile, if you use control-x;m (on a mac or on linux when control isn't your menu key) you should be able to rename. Or if your identifiers always have space between them, then you won't have trouble either.
Robby On Sun, Apr 26, 2015 at 11:25 AM, Jens Axel Søgaard <[email protected]> wrote: > Hi All, > > I have found a problem. The question is whether > the problem is in the example or in the alpha renaming > done by DrRacket: > > #lang racket > ;;; Minimal example that shows a problem when renaming > ;;; identifiers that bind an identifer whose name > ;;; is inside a string literal. > > ;;; The example below shows correct arrows (both bound and binding > identifiers). > ;;; Renaming a, b or + in the binding clauses of the let works. > ;;; Renaming (by right clicking) the a in the string renames both a and + ! > > (define-syntax ($ stx) > (syntax-case stx () > [(_ str) > (let () > (define s (syntax-e #'str)) > (define x (string->symbol (string (string-ref s 0)))) > (define y (string->symbol (string (string-ref s 2)))) > (define op (string->symbol (string (string-ref s 1)))) > (define src (syntax-source stx)) > (define line (syntax-line #'str)) > (define pos (syntax-position #'str)) > (define col (syntax-column #'str)) ; column of " > (displayln (list 'col col)) > (define span 1) > (define (make-srcloc i) > ; add 1 to get past the " > (list src line (+ col 1 i) (+ pos 1 i) span)) > (with-syntax ([x (datum->syntax #'str x (make-srcloc 0) #'str)] > [y (datum->syntax #'str y (make-srcloc 2) #'str)] > [op (datum->syntax #'str op (make-srcloc 1) #'str)]) > #'(op x y)))])) > > (let ([a 2] > [b 3] > [+ *]) > ($ "a+b")) > > > /Jens Axel > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

