[plt-scheme] Problems with class definition

From: Zbyszek Jurkiewicz (zbyszek at duch.mimuw.edu.pl)
Date: Mon Nov 18 04:47:16 EST 2002

(send m rows)

[First object then method name]

Zbyszek Jurkiewicz

On Thu, 14 Nov 2002, 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.