In this discussion, it was pointed out that this can make code more confusing when the define form in question is inside the body of a class. Within a class, define creates a field and define/public and related class-specific forms create methods. A definition like (define f (lambda (x) (+ x 42))) in such a context is intended to be an instance-specific field (possibly a callback, especially in GUI code) but rewriting that to (define (f x) (+ x 42)) obscures whether it's instance-specific state or just a private method. Resyntax should avoid performing this rewrite within class bodies.
Resyntax currently rewrites this:
To this:
In this discussion, it was pointed out that this can make code more confusing when the
define
form in question is inside the body of a class. Within a class,define
creates a field anddefine/public
and related class-specific forms create methods. A definition like(define f (lambda (x) (+ x 42)))
in such a context is intended to be an instance-specific field (possibly a callback, especially in GUI code) but rewriting that to(define (f x) (+ x 42))
obscures whether it's instance-specific state or just a private method. Resyntax should avoid performing this rewrite within class bodies.