[plt-scheme] Problems with class definition

From: Robert Bruce Findler (robby at cs.uchicago.edu)
Date: Sat Nov 16 10:38:58 EST 2002

You want:

  (send m rows)

rather than

  (send rows m)

Robby

At Thu, 14 Nov 2002 23:12:36 +0100, Harald Schmidt wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I would like to define a matrix class, the syntax check is okay, but the
> object doesn't understand the rows method. Could anyone tell me
> what's wrong with the definition.
> 
> Harald
> 
> (define matrix<%> (interface () rows))
> 
> (define matrix%
>    (class* object% (matrix<%>)
> 
>      (init-field (rows-size 0) (cols-size 0))
> 
>      (define/public rows
>        (case-lambda
>          ((new-rows-size) (set! rows-size new-rows-size))
>          (() (rows-size))))
> 
>      (super-instantiate ())))
> 
> (define m (instantiate matrix% ()))
> (send rows m)
> 
> Welcome to DrScheme, version 202.
> Language: Pretty Big (includes MrEd and Advanced) custom.
> reference to undefined identifier: rows
>  > 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 8.0 (Build 288) Beta
> 
> iQA/AwUBPdQf8GgKkgULCgvHEQLNagCgjtVLFGJMHg4CcPxWoQ1I3dFewhoAoKQe
> dtlenE5V55RdkoJXpnO1jJJH
> =8svP
> -----END PGP SIGNATURE-----



Posted on the users mailing list.