How can I print definition of a symbol without evaluation in Scheme?
If I want to print function de开发者_StackOverflowfinition for a symbol, what should I do?
If I understand correctly, you want a function print-function
such that after
(define (foo x) (cons x x))
it will behave as
> (print-function foo)
(lambda (x) (cons x x))
Standard Scheme doesn't have a facility for that. The reason is Scheme implementations may, and generally do, compile functions into a different representation (bytecode, machine code).
Some Schemes may keep the function definition around; check your implementation's manual.
精彩评论