[comp.windows.ms.programmer] Actor specific questions

pcb@basin04.cacs.usl.edu (Peter C. Bahrs) (03/15/91)

This is from the Actor work space :
sin(pi);                      /* yuck ! */
-7.657135492e-016
cos(pi)
-1.
sin(pi/2.0);
1.
cos(pi/2.0);                    /* yuck ! */
-3.828567746e-016
sin(0)
0.
cos(0)
1.
sin(pi/3)
0.8660254038
cos(pi/3)
0.5

Bummer hey?  Oh well, its hard to do numerically precise stuff I guess.
Also, How do you enter a negative number?  For example
    a:= -10@30    does not work!   /* this is an implicit new(Point) call */
I can however do a:=new(Point); setX(a,-10); though.  This is also true
for the polygon and rectangle commands.  Also in an expression, you
may want to negate an object such as a:=4;
           method(object, -a, 3);  this does not work?  I have
been using either  minusOne*a  or 0-a   ughhh.

And finally, for now, has anyone figured out how to modify the interpreter
so that when an application does something stupid and the debugger
comes up, the application will not try to process any more messages?
i.e. draw(line,port) when p1 of line is still nil.  MS windows line
command doesn't like this, neither does actor.  The debugger comes up,
which may cause a repaint message to the app, ... recursive errors until
the machine hangs.   ughhh again...

I mentioned in a previous posting about BC++ that the lack of classes
was a major drawback.  But I suspect that the 'C' impact on the environment
's development is a benefit over actor and smalltalk, which add another
layered interpreter to goof things up.  Don't get me wrong though, actor
and smalltalk are nice, but you  really get to know your environment.
 


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

adw@otter.hpl.hp.com (Dave Wells) (03/19/91)

From: pcb@basin04.cacs.usl.edu (Peter C. Bahrs)
Date: Fri, 15 Mar 1991 07:45:23 GMT
Subject: Actor specific questions
Newsgroups: comp.windows.ms.programmer

>Also in an expression, you may want to negate an object such as a:=4;
>           method(object, -a, 3);  this does not work?  I have
>been using either  minusOne*a  or 0-a   ughhh.

method(object, negate(a), 3);

>And finally, for now, has anyone figured out how to modify the interpreter
>so that when an application does something stupid and the debugger
>comes up, the application will not try to process any more messages?

Not in general. The paint() -> debugger -> paint() -> debugger...
loop can be solved:

Def paint(self, hdc)
{ if frames(Bug)
  then printLine(asString(class(self))+":paint() called, but a Debug window"+
            " was up."
  else
    draw(self,hdc);       /* (or whatever) */
  endif;
}

This seems to allow you to get into the debugger reliably. If you keep
hitting "OK" on the debug dialog, however, ACTOR siezes up after a few more
repaints - cause unknown.

Hope this helps,

Dave Wells