Applying a symbol as a procedure

后端 未结 3 1000
囚心锁ツ
囚心锁ツ 2021-01-21 19:32

Suppose I have a simple symbol:

> \'+
+

Is there any way I can apply that symbol as a procedure:

> ((do-something-with \'         


        
3条回答
  •  醉话见心
    2021-01-21 19:56

    I'm not 100% sure, but would:

    ((eval '+) 1 2)
    

    work? I'm not sure if you need to specify the environment, or even if that works - I'm a Scheme noob. :)

提交回复
热议问题