开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜