简体   繁体   中英

Scheme (Racket) how to return a string in a list without quotation

I'm trying to return a list of strings.

I am using (list “stringA” “stringB”)

And it is returning “string A” “stringB”

Is there anyway it can return stringA stringB ?

There are different ways of making a list. Some basic lists are:

(f x y)     ; run function f, substitute values x and y
(list x y)  ; create list, substitute values x and y
'(x y)      ; create list, don't substitute x and y

(quote x y) ; Common Lisp alternative of '(x y)

If you go for (list stringA stringB) then Scheme will try to replace stringA stringB with their values.

What you want is '(stringA stringB)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM