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

Re: simple method dispatch question



In article <pIYO5.37190$n9.1228821@news2.rdc1.on.home.com>, "Michael T. 
Richter" <mtr@ottawa.com> wrote:

> I was always wondering why I'd want to have an argument to a
> function  with a specific value instead of a specific type. 
> Now I see why.

define method action(obj :: <button>, what == mouseDown)
   obj.highlight();
end;

define method action(obj == saveButton, what == mouseUp)
   SaveDocument();
end;

define method action(obj == menuBar, what == mouseDown)
   DisplayMenu();
end;


-- Bruce



Follow-Ups: References: