Re: [Objectscript-users] Addition to OScript syntax
Brought to you by:
rob_d_clark
From: Rob C. <ro...@ti...> - 2005-12-02 16:58:42
|
Hmm, I've recently just added a qualified "this" syntax, for example =20 "Foo.this"... the way it is currently supported is "Foo.this" =20 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 =20 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 =20 > "A" and > call its print method. I don't think that this is a difficult =20 > addition to > the syntaxt, but i'm completely unknown to JavaCC and how you used =20 > 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 =20 > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD =20 > 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 |