Racket 球拍:“;字符串ith";不在正常的球拍下工作
我在Racket 球拍:“;字符串ith";不在正常的球拍下工作,racket,Racket,我在Emacs中的Geiser环境中使用(带“hello”3的字符串)。它显示了一个错误 string-ith: undefined; cannot reference an identifier before its definition in module: top-level context...: eval-one-top /usr/share/racket/collects/racket/repl.rkt:11:26 我在Racket博士的IDE中尝试了同样的方
Emacs
中的Geiser
环境中使用(带“hello”3的字符串)
。它显示了一个错误
string-ith: undefined;
cannot reference an identifier before its definition
in module: top-level
context...:
eval-one-top
/usr/share/racket/collects/racket/repl.rkt:11:26
我在Racket博士的IDE中尝试了同样的方法。使用默认的#lang racket
,它会抛出相同的错误
> (string-ith "hello" 3)
. . string-ith: undefined;
cannot reference an identifier before its definition
>
但随着将语言改为初级学生,它工作正常
> (string-ith "hello" 3)
"l"
>
我试过使用(需要球拍/弦)
,但没有用
我发现使用
球拍
很困难。谁能解释一下原因吗?很简单,正如错误所说,这些语言中没有预定义过程。作为一种方便,它在初学的学生中提供
如果需要,那么使用现有的过程,如
substring
,自己定义它。或者,如果你动力不足,建议一种导入方法。谢谢。我想正常的使用方法是string ref
函数。