How do I get a definition's name as a symbol?
问题 How do I get a definition's name as a symbol in Scheme and/or Racket? Suppose I have these definitions: (define bananas 123) (define multiply *) (define (pythagoras a b) (sqrt (+ (* a a) (* b b)))) How can I define def->symbol where: (def->symbol bananas) returns 'bananas (def->symbol multiply) returns 'multiply (def->symbol pythagoras) returns 'pythagoras Is this a case where I have no choice but to learn and use these advanced things called "macros"? 回答1: Just as you suspect, we need to use