[racket] Cube two numbers

From: John Clements (clements at brinckerhoff.org)
Date: Fri Sep 14 19:37:58 EDT 2012

On Sep 14, 2012, at 4:26 PM, Ashley Fowler wrote:

> I have to make this code called cube-two where it takes two numbers and cubes the both of them .
> This is what I have so far:
> (define cube-two(lambda(X Y)(list'(* X X X)(* Y Y Y))
> but the problem is, is that it only executes Y like the example below...
> > (cube-two 3 4)
> ((* x x x) 64)
> How would I make it so it will execute both numbers?

Short answer: don't use quote. 

Quote is an advanced "shorthand" tool; come back to it after you're more familiar with lists.

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120914/7408b4b9/attachment.p7s>

Posted on the users mailing list.