[comp.windows.ms.programmer] Actor 3.0 !!!!argh$#$!!!

pcb@gator.cacs.usl.edu (Peter C. Bahrs) (11/30/90)

I have been trying to do some things in actor and it barfs! I have found
out from trial and error and from whitewater:

1) Max size of a method is (5 or 8, I forgot)K !!!!argh
2) If you snapshot with not enough disk space, the image gets corrupted! argh
3) If your application is in error and the debugger comes up, the app.
   still gets windows messages!   argh!!!!!!!!!!!!!
Whitewater says they know about 1-3 and are making a fix for 3.01 due in
   early spring.

4) I have had this small chunk of code for a while, load it, it does not work.
   Why? I am not sure.  Maybe I don't know actor enough. Should I ask Bo?
    I just want to:
     a:=new(Matrix);
     b:=new(Matrix);
     init(a); init(b);
     put(a,0,0,10); put(a,3,2,5);
     put(b,0,0,5); put(a,3,2,8);
     at(b,0,0);  => 10
     but c:=mmult(a,b); does not work???  !!!argh!!!  The class is below



/* class comment */!!

inherit(Object, #Matrix, #(row0
row1
row2
row3
), 2, nil)!!

now(class(Matrix))!!

now(Matrix)!!

/* multiply two 4X4 matrices */
Def mmult(self, mat | temp, dotp,i,j,k)
{
  
  temp := new(Matrix);
  temp := init(temp);
  
  i:=0;   
  loop while i < 4
     j:=0;
     loop while j < 4
        k:=0;
        dotp:=0;
        loop while k < 4
         /*print(at(self,i,k)); print(at(mat,k,j));*/ /* these print fine */
         dotp:=dotp+at(mat,k,j)*at(self,i,k);
         k:=k+1;
        endLoop;
        put(temp,i,j,dotp); 
     j:=j+1;
     endLoop;
  beep();
  i:=i+1;
  endLoop;
  
  ^temp;
 }!!

/* return the value of the matrix at (row,col) */
Def at(self, row, col)
{
  select
    case row = 0 is ^asInt(at(row0, col)); endCase
    case row = 1 is ^asInt(at(row1, col)); endCase
    case row = 2 is ^asInt(at(row2, col)); endCase
    case row = 3 is ^asInt(at(row3, col)); endCase
    default  ^0;
  endSelect;
 }
!!

/* comment */
Def sum (self | localsum)
{ 
  localsum:=0;
  do (size(row0),
     {using(i) 
        localsum := localsum + at(row0,i);
        localsum := localsum + at(row1,i);
        localsum := localsum + at(row2,i);
        localsum := localsum + at(row3,i);
     }); 
   ^localsum;  
   }
!!

/* Put the value into location (row, col) of Matrix. */
Def put(self, row, col, value)
{
  select
    case row = 0 is put(row0, value, col); endCase
    case row = 1 is put(row1, value, col); endCase
    case row = 2 is put(row2, value, col); endCase
    case row = 3 is put(row3, value, col); endCase
    default ;
  endSelect;
  
  ^self;
}
!!

/* comment */
Def init(self)
{ 
  row0 := new(Array,4);
  row1 := new(Array,4);
  row2 := new(Array,4);
  row3 := new(Array,4);
  fill(row0,0); fill(row1,0); 
  fill(row2,0); fill(row3,0);
  put(row0,1,0) ;
  put(row1,1,1) ;
  put(row2,1,2) ;
  put(row3,1,3) ;
  ^self;
}!!



/*----------- Thanks in advance... --------------------------------------+
| Peter C. Bahrs                                                         |
| The USL-NASA Project                                                   |
| Center For Advanced Computer Studies      INET: pcb@gator.cacs.usl.edu |
| 2 Rex Street                                                           |
| University of Southwestern Louisiana      ...!uunet!dalsqnt!gator!pcb  | 
| Lafayette, LA 70504                                                    |
+-----------------------------------------------------------------------*/