[racket] structures question

From: Eduardo Bellani (ebellani at gmail.com)
Date: Thu Mar 29 10:30:46 EDT 2012

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The error you are getting is about your use of the check-expect function.

- From the docs, the function signature:

(check-expect expression expected-expression)

So you have to provide what you expect the call to manhatten to
return, along with your call to it.



On 03/29/2012 11:20 AM, Roelof Wobben wrote:
> Hello,
> 
> Im trying to make a programm which use structures and calculates
> the distance between a point and another point. The first point has
> coordinates (0,0).
> 
> So I made this :
> 
> ;; Posn -> Number. ;; A programm for calculating the distance is
> Manhatten (check-expect ( manhatten (make-posn 7 3 ) 10)) 
> (check-expect ( manhatten (make-posn 1 1 ) 2))
> 
> (define (manhatten pos-manhatten) ( + (pos-y posmanhetten) (pos-x
> manhetten)))
> 
> I get this message :
> 
> check-expect: expects 2 arguments, but found only 1
> 
> But there is only 1 argument the structure pos-manhatten.
> 
> Roelof ____________________ Racket Users list: 
> http://lists.racket-lang.org/users


- -- 
Eduardo Bellani

fear is an alarm, not a compass.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk90cgYACgkQSbLl0kCTjGkS3QCeIquvJ8x1tI1T0/PzZ4wWFptP
dY4An2XZHfHWa/HXoEXxFXC8ibABOBG+
=STb7
-----END PGP SIGNATURE-----

Posted on the users mailing list.