set-car!, set-cdr!无拘无束的球拍? [英] set-car!, set-cdr! unbound in racket?

查看:32
本文介绍了set-car!, set-cdr!无拘无束的球拍?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想用 racket 中的 set-car!set-cdr! 做非常简单的代码,但我得到了错误:expand: unbound identifier in module in: set-car!expand: unbound identifier in module in: set-cdr!

I am just trying to do very simple code with set-car! and set-cdr! in racket, but I got the error: expand: unbound identifier in module in: set-car! and expand: unbound identifier in module in: set-cdr!

它们不是在球拍中定义的吗?有人可以帮忙吗?

Aren't they defined in racket? Could anyone help?

推荐答案

需要导入mutable-pairs-6,像这样:

(require rnrs/mutable-pairs-6)

那些程序被移到不同的模块并重命名为mconsmcarmcdrset-mcar!set-mcdr!mlist 强调它们对可变数据进行操作,而不像它们的不可变对应物.

Those procedures were moved to a different module and renamed to mcons, mcar, mcdr, set-mcar!, set-mcdr!, mlist to emphasize that they operate on mutable data, unlike their immutable counterparts.

这篇关于set-car!, set-cdr!无拘无束的球拍?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆