swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Discrete2d - protocol


From: Thorsten Schelhorn
Subject: Discrete2d - protocol
Date: Wed, 22 Jul 1998 14:53:43 +0100

I'm trying to read a pgm file into a Discrete2d-object as suggested by the
documentation, but get a very strange error message:

  d = [Discrete2d createBegin: globalZone];
printf( "0 " ); fflush(stdout);
  [d setSizeX: 10 Y: 10];
printf( "1 " ); fflush(stdout);
  [d createEnd];
printf( "2 " ); fflush(stdout);
 
  [d setDiscrete2d: d toFile: "../walk.pgm"];
printf( "3 " ); fflush(stdout);

produces:

0 1 2 *** event raised for error: ProtocolViolation
Object `c?v' Px' T& ' does not comply to Discrete2d protocol
*** execution terminating due to error
Abort (core dumped)

which is obviously not what I hoped to get.
Browsing the source code, I found that the class Discrete2d does not adopt
the Discrete2d protocol, but the -setDiscrete2d:to: method checks that;
but, oddly enough, Value2dDisplay's setDiscrete2dToDisplay: method also
checks wether the argument complies to the Discrete2d protocol, but 
does NOT complain.
Can anyone explain what's going on, and how to get around this "feature"
of Discrete2d without changing the SWARM sources?

Btw, I'd also like to have some Collection classes, from which I could
easily subclass without reimplementing tenth of methods just to pass
messages through to the encapsulated collection...

Thorsten Schelhorn

address@hidden

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]