将字符串原语函数导入 MIT 方案

Import String Primitive Functions into MIT Scheme

使用 Scheme 的入门级编程课程通常使用包含 firstbf 等原始函数的版本(描述为 here)。

由于 this question,我在本地有 MIT Scheme 运行,但是当我尝试使用这些原始函数之一时它会抛出以下错误。

MIT/GNU Scheme running under OS X
Type `^C' (control-C) followed by `H' to obtain information about interrupts.

Copyright (C) 2014 Massachusetts Institute of Technology
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Image saved on Saturday May 17, 2014 at 2:39:25 AM
Release 9.2 || Microcode 15.3 || Runtime 15.7 || SF 4.41 || LIAR/x86-64 4.118
Edwin 3.116

1 ]=> (first 'hello)

;The object hello, passed as an argument to safe-car, is not a pair.
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

如何将这些原始函数导入方案中使用?

见510页,附件说明需要下载支持码:

https://people.eecs.berkeley.edu/~bh/pdf/ssch27.pdf

FWIW 有一个适用于 Racket 的 Simply Scheme 包

https://pkgs.racket-lang.org/package/simply-scheme