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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a52c822fc0dbb23 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!edtnps82.POSTED!53ab2750!not-for-mail Sender: blaak@METROID Newsgroups: comp.lang.ada Subject: unifying arrays and records (was Re: Rational for not making cursor tagged in Containers) References: <1176998738.656903.141250@q75g2000hsh.googlegroups.com> <1177010938.200523.325290@p77g2000hsh.googlegroups.com> <1a8y2vakorfhx.225uqh4hifpd$.dlg@40tude.net> <1xmzi7newnilp.23m3zze8h9yi.dlg@40tude.net> <1177066583.5876.30.camel@localhost.localdomain> <1177080147.5876.87.camel@localhost.localdomain> <1q1kx2jlcvnuj.ck0711mj4few$.dlg@40tude.net> From: Ray Blaak Message-ID: Organization: The Transcend User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 21 Apr 2007 04:48:17 GMT NNTP-Posting-Host: 154.20.94.243 X-Trace: edtnps82 1177130897 154.20.94.243 (Fri, 20 Apr 2007 22:48:17 MDT) NNTP-Posting-Date: Fri, 20 Apr 2007 22:48:17 MDT Xref: g2news1.google.com comp.lang.ada:15184 Date: 2007-04-21T04:48:17+00:00 List-Id: "Randy Brukardt" writes: > The better question is why there are arrays at all. A homogeneous container > is by definition more limited than a heterogeneous one. So, the ideal > language would find a way to completely unify arrays and records. Perhaps > the array syntax would have to remain, but it would just be a language > defined synonym for a record access. Believe it or not, ECMAScript/JavaScript manages to do it. obj.field is equivalent to obj["field"], like an implicit hashmap lookup. obj[1] is just another lookup. Now JavaScript is a wierd completely dynamic language. The kinds of games it plays really relies on its non-staticness to work. It is actually closer to Lisp rather than anything else, just with a Java-ish syntax, even down to its functions being equivalent to full blown closures. It has nothing at all to do with Java though. I both hate it and love it at the same time. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.