Re: Diamond preprocessor syntax
- Posted by jbrown1050 at hotpop.com May 16, 2003
- 421 views
Just wanna say I'd prefer if methods could be either procedures or functions. Of course, if thats not possible then its not possible. jbrown On Fri, May 16, 2003 at 01:02:58AM -0700, Mike Nelson wrote: > > jbrown wrote <snip> > > > Hmm ... how many other OO languages have events? how many non-OO langs > have > > it for that matter? > > > > and what syntax do they use? > </snip> > > Java (implemented as methods), VB.net (methods but some "third thing" > features), I'm sure there are others. The key defining characteristic is > the ability to attach a routine (the event handler) to individual objects of > the same class. Thus each object of the MyObject class can have a differnt > code executed when its My Event event is raised, while the same code will > execute for each object when its MyMethod method is called. > > Your syntax suggestions are good, but on further reflection dot notation can > be used unambiguously. > > x.y(a)=z can't be a set_property() or a call_method(), so it can be a > raise_event(). > > Actually if we require a method's return value to be used, dot is not > ambiguous for events, either: > > w=x.y(z) > if x.y(z) then . . . > {x.y(z),1,"string"} > > and so on are call_methods(), while > > x.y(z) > if w then x.y(z) . . . > > are events. In general, if we find x.y(z) where Eu allows a function, it is > call_method(), where Eu allows a procedure, it is raise_event(), on the left > side of an assignment it is link_handler(). > > -- Mike Nelson > > > > TOPICA - Start your own email discussion group. FREE! > > -- /"\ ASCII ribbon | http://www.geocities.com/jbrown1050/ \ / campain against | Linux User:190064 X HTML in e-mail and | Linux Machine:84163 /*\ news, and unneeded MIME |