From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 8C8C2BC0A for ; Sat, 13 Jan 2007 06:56:49 +0100 (CET) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0D5untH001873 for ; Sat, 13 Jan 2007 06:56:49 +0100 Received: by nf-out-0910.google.com with SMTP id q29so1484983nfc for ; Fri, 12 Jan 2007 21:56:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=gnO+t64KWX0aoD2p81KPU/IU2ibOBHfB5ydlYCeiIOGtwiavnpWiHoc+T/JXhqSHUhruajhxGQri3O9SajTVab7frKrHh93WH9e6WDDv/5zAy9Z+nIJ3MC4nID4Wiwf2AQEDCF1YG9WbslrVuAXPKf6hX8QP9MKVvxYCtNaa+Kg= Received: by 10.82.165.1 with SMTP id n1mr274582bue.1168667808341; Fri, 12 Jan 2007 21:56:48 -0800 (PST) Received: by 10.82.175.13 with HTTP; Fri, 12 Jan 2007 21:56:48 -0800 (PST) Message-ID: Date: Sat, 13 Jan 2007 06:56:48 +0100 From: Tom To: "Edgar Friendly" Subject: Re: [Caml-list] Ocaml compiler features Cc: caml-list@yquem.inria.fr In-Reply-To: <45A87011.8080203@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_79749_7442640.1168667808298" References: <45A87011.8080203@gmail.com> X-j-chkmail-Score: MSGID : 45A874A1.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45A874A1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 variants:01 variants:01 arrays:01 arrays:01 monster:98 supple:98 monster:98 supple:98 integer:01 integer:01 caml-list:01 movie:96 movie:96 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_79749_7442640.1168667808298 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline > > > Second, I have some ideas of things to do with Atomic Variants (sounds > like they could be a monster in a sci-fi movie). First thing is to > somehow allow the use of a type composed of all Atomic (non-polymorphic) > Variants as an integer type. One thing I want to do is index arrays > with them. > Hm... instead of having type food = Carrot | Apple | Pizza | Coke | Sushi let in_supply = Array.create 5 0 in_supply.(Coke) <- 20 you could do it like this instead let carrot, apple, pizza, coke, sushi = 0, 1, 2, 3, 4 let in_supple = Array.create 5 0 in_supply.(coke) <- 20 . What do you think? - Tom ------=_Part_79749_7442640.1168667808298 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

Second, I have some ideas of things to do with Atomic Variants (sounds
like they could be a monster in a sci-fi movie).  First thing is to
somehow allow the use of a type composed of all Atomic (non-polymorphic)
Variants as an integer type.  One thing I want to do is index arrays
with them. 

Hm... instead of having

  type food = Carrot | Apple | Pizza | Coke | Sushi
 
  let in_supply = Array.create 5 0
 
  in_supply.(Coke) <- 20

you could do it like this instead

  let carrot, apple, pizza, coke, sushi = 0, 1, 2, 3, 4

  let in_supple = Array.create 5 0
 
  in_supply.(coke) <- 20

. What do you think?

- Tom
------=_Part_79749_7442640.1168667808298--