#import "EvalObject.h" 
#import <appkit/appkit.h>

/**
 ** EvalObjects are just like Objects, 
 ** except that they do not kill off
 ** the application when they receive
 ** a message they can't understand.
 ** Instead, they pop up an alert panel,
 ** allowing the user to either continue,
 ** abort the evaluation (by raising an exception),
 ** or abort Eval.
 **/

@implementation EvalObject: Object
{
}

+ doesNotRecognize: (SEL)aSelector ;
{ int rval ;
  rval = NXRunAlertPanel("Eval",
     "\tError:\n Class %s doesNotRecognize:\n\t+%s","Continue","Abort Eval",
      NULL, [self name], sel_getName(aSelector)) ;
  if(rval == 1) // i.e. continue
    return self ;
  [self error: "Eval aborted by user\n"] ;
  return self ;
} 

 
- doesNotRecognize: (SEL)aSelector ;
{ int rval ;
  rval = NXRunAlertPanel("Eval",
     "\tError:\nInstance %s of class %s doesNotRecognize:\n\t-%s","Continue","Abort Eval",
      NULL, [self name], [[self class] name], sel_getName(aSelector)) ;
  if(rval == 1) // i.e. continue
    return self ;
  [self error: "Eval aborted by user\n"] ;
  return self ;
} 


@end