From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA26954 for caml-redistribution; Wed, 19 Jan 2000 14:40:01 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA22747 for ; Tue, 18 Jan 2000 17:34:14 +0100 (MET) Received: from cepheus.azstarnet.com (cepheus.azstarnet.com [169.197.56.195]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id RAA29558 for ; Tue, 18 Jan 2000 17:34:07 +0100 (MET) Received: from vega (dialup002ip384.tus.azstarnet.com [169.197.15.128]) by cepheus.azstarnet.com (8.9.3+blt.Beta0/8.9.3) with SMTP id JAA17748 for ; Tue, 18 Jan 2000 09:33:56 -0700 (MST) X-Sent-via: StarNet http://www.azstarnet.com/ Message-ID: <007501bf61d1$e956c420$250148bf@vega> From: "David McClain" To: Subject: Compiler translation of array indexing Date: Tue, 18 Jan 2000 09:34:35 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Sender: weis I would like to suggest a slightly more expressive form for the translation of array indexing operators x.(..) and x.[..]. In Dylan these get translated into message sends to generic function "element" (or "aref" in the case of multiple indices). Instead of translating as in OCAML to Array.get and Array.set, they could be translated into some equivalent to x.(n) -> module_of(type_of x).get(x, n) This would allow us to develop modules containing refined versions of get, set, unsafe_get, and unsafe_set to do whatever would be appropriate for the object being indexed. Currently, I don't know of any operators named "module_of" and "type_of" and these might in fact not make much sense given the vast optimizations performed in the compiler -- there are not unique tags for disparate data types since the language is type checked at compile time. Just some thoughts and wishes... David McClain, Sr. Scientist Raytheon Systems Co. Tucson, AZ