[racket] Confused between strings and symbols
You may wish to read through HtDP/2e:
http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html
strings: "silly"
symbols: 'silly
all lists are made from cons and empty,
list
quote '
quasiquote `
unquote ,
are abbreviations that expand to lists:
http://www.ccs.neu.edu/home/matthias/HtDP2e/i2-3.html
If any of this makes you feel uncomfortable, use DrRacket's language menu to control the printer:
Language -> Choose Language -> Show Details
choose the constructor-style printing and all lists will be shown as cons-es, which is what they really are.
-- Matthias
On Oct 27, 2013, at 4:23 PM, Bo Gus wrote:
> If I evaluate this:
>
> (list 'this '(is silly))
>
> I get this:
>
> '(this (is silly))
>
> I just want to check I understand what is happening here.
>
>
> list always returns a proper list hence I see no dotted notation here.
>
> The return value is quoted which means it is a symbol? But there are spaces so can it be a symbol? And in addition, list returns a proper list so it is a list? A symbolic list?
>
> Or does the quote in returned just mean it is string data in the list?
>
> The nested parentheses around is silly is indicating that this is a inner list - a list within a list? What is in the inner list? Two strings? One string made up of the characters i, s, space, s, i, l, l, y ?
>
> I suppose the thing that confuses me the most is the idea of a symbol. There are no quotes around the textual information in the returned data so do I assume the text is not string data? If so are they symbols?
>
> Please help clarify.
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users