如何在 DrScheme 中重新定义常量标识符? [英] How can you re-define a constant identifier in DrScheme?

查看:56
本文介绍了如何在 DrScheme 中重新定义常量标识符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 DrScheme 编写一个 Scheme 解释器.我定义了一个读取评估打印循环,我正在重新定义评估过程.这在 Chez Scheme 等其他方案实现中效果很好,但我不喜欢 Chez Scheme 中的代码编辑,所以我想为此使用 DrScheme.

I am using DrScheme to write a Scheme interpreter. I define a Read Eval Print Loop and I am re-defining the eval procedure. This works fine in other scheme implementations like Chez Scheme, but I don't like the code editing in Chez Scheme, so I would like to use DrScheme for this.

当我做出如下定义时:(定义(eval exp env)(cond ...))它说:定义值:无法更改常量标识符:eval

When I make a definition such as: (define (eval exp env) (cond ...)) It says: define-values: cannot change constant identifier: eval

有没有办法覆盖它并让我更改常量标识符?我宁愿不必重命名我的所有变量来解决这个问题.

Is there a way to override that and let me change constant identifiers? I'd prefer not to have to rename all my variables to get around this.

推荐答案

事实证明每种语言都有选项,其中之一是禁止重新定义初始绑定",可以取消选中.

It turns out there are options per each language and one of them is "Disallow redefinition of initial bindings" which can be unchecked.

这篇关于如何在 DrScheme 中重新定义常量标识符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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