为什么这些字符串在Racket中有所不同

时间:2016-08-13 13:13:32

标签: scheme racket

我正在运行以下代码:

(define  myframe  (new frame% [label "myframe"]))

(define tf1 (new text-field%  [parent myframe] [label "tf1"]))
(define tf2 (new text-field%  [parent myframe][label "tf2"]))
(define tf3 (new text-field%  [parent myframe][label "tf3"]))

(send  myframe show #t)

(define combined_str (string-append (send tf1 get-value) "-" (send tf2 get-value) "-" (send tf3 get-value) )) 
(println combined_str)
(if (eq? "--" combined_str) "same" "different")

输出是:

"--"
"different"

combined_str是" - "因为文本字段是空白的。但它并不像" - "。

那样

0 个答案:

没有答案