Re: [Objectscript-users] Addition to OScript syntax
Brought to you by:
rob_d_clark
From: <ar...@va...> - 2005-12-03 11:28:28
|
I'm glad you understand what i mean. I was not sure if it was clearly stated below. I have based this on the LPC language created by Lars Pensj= =F6 for his LP-MUD. It supports the "::" to point at specific inherited objects. It also uses "::method()" as the "super" qualifier used in Java. But i think it is just a matter of syntax choice on how to implement this= . I think what you proposed will get the job done as well. In what version of OScript did you implement the qualified "this" syntax? > Hmm, I've recently just added a qualified "this" syntax, for example > "Foo.this"... the way it is currently supported is "Foo.this" > evaluates to the nearest "this" which is a "Foo". As in: > > function Outer() > { > private var a =3D 1; > function Inner() > { > private var a =3D 2; > > public function test() > { > private var a =3D 3; > > { > var a =3D 4; > > writeln("a: " + a); > writeln("test.this.a: " + test.this.a); > writeln("this.a: " + this.a); > writeln("Inner.this.a: " + Inner.this.a); > writeln("Outer.this.a: " + Outer.this.a); > } > } > } > } > > maybe it would sense to support mixin's in a similar way, so you > could do something like "A.this.print()"? > > thoughts? > > > On Dec 2, 2005, at 6:49 AM, <ar...@va...> wrote: > >> Rob, >> >> Is it difficult to add the following to the OScript syntaxt: >> >> function A() { >> public function print() {} >> } >> >> function B() { >> mixin new A(); >> >> public function print() { >> A::print(); >> ^^^^^^^^^^^ >> // do other print stuff >> } >> } >> >> "::" means in this case that you specifically point to the object >> "A" and >> call its print method. I don't think that this is a difficult >> addition to >> the syntaxt, but i'm completely unknown to JavaCC and how you used >> it in >> OScript. >> >> Maybe you can point me in some direction to have this included. >> >> thank you very much. >> >> Regards, >> >> Arjen van Efferen >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. Do you grep through >> log files >> for problems? Stop! Download the new AJAX search engine that makes >> searching your log files as easy as surfing the web. DOWNLOAD >> SPLUNK! >> http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick >> _______________________________________________ >> Objectscript-users mailing list >> Obj...@li... >> https://lists.sourceforge.net/lists/listinfo/objectscript-users > > -- Rob > > ____________________ > CONTACT INFORMATION: > email: ro...@ti... > IM: rob@sandjabber > desk: 1 858 552 2946 > cell: 1 619 300 9661 > > > > |