From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aef01dc1d0a3a8bd X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: Dummy Date: 2000/02/07 Message-ID: <873dr4pz44.fsf@deneb.cygnus.argh.org>#1/1 X-Deja-AN: 582804616 References: <387b154a.3533365@newsread.albacom.net> <3898C380.BC01EC03@earthlink.net> <3899DB45.B481F8E2@averstar.com> <87bt5wlt8l.fsf@deneb.cygnus.argh.org> Mail-Copies-To: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cygnus.argh.org X-Trace: deneb.cygnus.argh.org 949953275 914 192.168.1.2 (7 Feb 2000 19:54:35 GMT) Organization: Penguin on board User-Agent: Gnus/5.0804 (Gnus v5.8.4) Emacs/20.4 Mime-Version: 1.0 Reply-To: Florian Weimer NNTP-Posting-Date: 7 Feb 2000 19:54:35 GMT Newsgroups: comp.lang.ada Date: 2000-02-07T19:54:35+00:00 List-Id: Hyman Rosen writes: > class a > { > interface i > { > int get(); > void set(int n); > } > i local_ref() > { > int local; > return new i { > int get() { return local; } > void set(int n) { local = n; } > }; > } > static void main(String[] v) > { > i i1 = local_ref(); > i i2 = local_ref(); > i1.set(3); > i2.set(4); > System.out.println(i1.get()); > System.out.println(i2.get()); > } > } This prints `3' and `4', doesn't it? Cool. I didn't know that Java supports class closures. Now Java only needs operator overloading and some syntactic sugar for dispatching by name and introspection, and Java will become my favorite scripting language. ;)