球拍与Scheme有何不同? [英] How is Racket different from Scheme?

查看:74
本文介绍了球拍与Scheme有何不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

球拍是Scheme的后代.球拍与R6RS有何不同?它增加了什么或带走了什么,或者只是有所不同?

Racket is a descendant of Scheme. How is Racket different than R6RS? What did it add, or take away, or is just different?

我知道Racket不仅仅是一种语言,它还是多种语言的平台.但我指的是主要的Racket方言.

I understand that Racket is more than a language, it's a platform for languages. But I'm referring to the main Racket dialect.

推荐答案

球拍最终基于R5RS,而不是R6RS,也不是两者的严格超集.我不认为它可以称为方案",因为它与任何Scheme标准都不向后兼容.

Racket is ultimately based on R5RS, and not R6RS and not a strict superset of either. I don't think it can be called 'Scheme' because it's not backwards compatible with any Scheme standard.

大多数实现都提供扩展,但是向后兼容,当然,Racket附带的编译器也可以在R5RS或R6RS模式下运行.在球拍模式下运行的有效R5/6RS方案可能会被拒绝,导致运行时错误或行为与预期不同.话虽如此,它不向后兼容的要点是:

Most implementations offer extensions, but are otherwise backwards compatible, of course, the compiler that comes with Racket can also run in R5RS or R6RS mode. Valid R5/6RS Scheme that runs in racket mode may either be rejected, cause runtime errors, or behave differently than it should. With that said, the main points where it is not backwards compatible are:

  • 球拍没有set-cdr!set-car!,而只有set-mcar!,仅适用于专门创建为可变的对.
  • 在R6RS中,Racket调用letrec被称为letrec*,在R5RS中不存在,在Racket中不存在R5RS和R6RS的调用letrec.
  • 在球拍中,很多事情都是自我评估的,这会引起R5RS中的错误,最重要的是空列表.
  • 球拍区分大小写,尽管R6RS也区分大小写
  • 球拍将( ... )[ ... ]等效,R5RS不会,但R6RS会.
  • Racket has no set-cdr! and set-car!, rather set-mcar! which only works on pairs specifically created as mutable.
  • What Racket calls letrec is called letrec* in R6RS and doesn't exist in R5RS, what R5RS and R6RS call letrec doesn't exist in Racket.
  • In Racket, a lot of things are self-evaluating which would raise an error in R5RS, most importantly the empty list.
  • Racket is case sensitive, though R6RS is also case sensitive
  • Racket treats ( ... ) and [ ... ] as equivalent, R5RS does not, but R6RS does.

可能还有更多,但是在大多数其他部件上,球拍是Scheme的超集.

There are probably more, but on most other parts racket is a superset of Scheme.

这篇关于球拍与Scheme有何不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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