Saying that (quote (1 2 3)) evaluates to (quote (1 2 3)) [instead to (1 2 3)] 
is the same nonsanse to me like saying that (+ 1 2) evaluates to (+ 1 2) 
[instead to 3].
 > From: s...@cs.brown.edu
> Date: Sun, 18 Sep 2011 11:15:41 -0400
> Subject: Re: [racket] Quoted expressions in #lang racket
> To: racketn...@hotmail.com
> CC: users@racket-lang.org
> 
> Yep, that's what he's saying.
> 
> I know why you're confused.  Let me see if I can help.
> 
> Here's an input program:
> 
>   '(1 2 3)
> 
> Now be careful to make the following distinction:
> 
> - what it computes
> - what it prints
> 
> What it computes is a list with three values.  There are at least
> three different ways to PRINT this:
> 
> 1.  (1 2 3)
> 2.  #<list>
> 3.  (quote (1 2 3))
> 
> The first has the disadvantage Matthias pointed out: you can't paste
> the value back in in a bigger computation.  The second has the same
> disadvantage.  The third has the advantage you can paste it back in.
> 
> You're probably concerned that pasting it back in "makes a new list".
> Yes, it does.  But if the expression '(1 2 3) were part of some bigger
> computation -- eg,
> 
>   (length '(1 2 3))
> 
> -- then no "new list" would be created.  So it's only if you try
> copying the output of one computation as the input of another that
> there might be new allocation.  But look at the word I just used:
> "copy".
> 
> This isn't the full answer, but I think you need to make sure you've
> got at least these steps under your belt before we go further.  Do ask
> questions.
> 
> Shriram
                                          
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to