In Scheme, if I wanted a list, say (1 2 3), I would just write '(1 2 3)
. Usually, this is fine, but it is actually equivalent to (quote (1 2 3))
, which is not exactly the same as (list 1 2 3)
. An example of when this would give different results:
'(1 2 (+ 0 3)) -> (1 2 (+ 0 3))
(list 1 2 (+ 0 3)) -> (1 2 3)
Is there a syntactical sugar for the second line here? For vectors there is. For example:
#(1 2 (+ 0 3)) -> #(1 2 3)
(vector 1 2 (+ 0 3)) -> #(1 2 3)
If there is no such sugar for list, that would be pretty ironic, because lists are used way more often than vectors in Scheme!