add1 function from scheme to R5RS

2019-07-21 00:00发布

I've written some code but it's not working because the add1 function I used in Scheme is not working with R5RS. What can replace add1 in R5RS?

2条回答
走好不送
2楼-- · 2019-07-21 00:23

late answer but an alternative is (making use of lambdas)..

(define add1 
    (lambda (x)
        (+ x 1)))
查看更多
一纸荒年 Trace。
3楼-- · 2019-07-21 00:41

The procedure add1 is very simple, you can implement it yourself:

(define (add1 x)
  (+ x 1))
查看更多
登录 后发表回答