问题
I'm guessing that #lang racket is a dialect of scheme with much more out of the box structures and common functions and perhaps would be more pedagogic. What are the perks a #lang racket against #lang scheme?
Is it best (or even possible) to use #lang scheme in racket to follow all the content of 'Structure and Interpretation of Computer Programs' or even 'How to Design Programs'. HtDP is #lang racket specific?
Whatever code written in #lang scheme, as long as libraries are not being included, can be used in chicken scheme or any main interpreter?
Thanks in advance.
回答1:
Yes,
#lang racketis the racket default dialect, with lots of extensions.Two places where it is not an extension:
ifmust have an else branch, and pairs are immutable (noset-car!andset-cdr!).#lang schemewas used for a while before the name change, and now#lang racketis used consistently. But we kept#lang schemearound for compatibility (as well as variousscheme/---libraries that are kept and can sometime be different thanracket/---counterparts). There's no reason to use#lang schemein new code.To follow SICP, don't use any of these -- there's a SICP language available (usable with
#lang sicp), originally written by Neil Van Dyke, but now maintained within the Racket community.To follow HtDP, don't use any of these, use the student languages. There are also new
#lang-based variants like#lang htdp/bslbut they're not in a complete shape, yet. (And HtDP is not#lang racketspecific.)No, Racket is very different from Chicken Scheme. You might be able to run some code in both, but those would probably be only tiny toy examples.
来源:https://stackoverflow.com/questions/7152416/differences-between-lang-scheme-and-lang-racket