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.1 required=5.0 tests=AWL,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 2674CBC6B for ; Fri, 11 May 2007 16:46:47 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.234]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4BEkjuR003578 for ; Fri, 11 May 2007 16:46:46 +0200 Received: by nz-out-0506.google.com with SMTP id s1so1049653nze for ; Fri, 11 May 2007 07:46:45 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g8iHCvaJ3THRIz7KgS97x8eMsicFLDLUYm8NWDDRS3aH41MHKrkgXxqjA97wKw13qotLaiqEjq78ZhoYw+fUgbJOTXyp0AdUBW9H/gzMBBOKKUvRwO7W/vIRDSpOfS4ffg/Ld6nmjasroLdKdEaF2oHvQCr2yQLYbKgS335sf4I= 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:content-transfer-encoding:content-disposition:references; b=hi30PUTRHFGsXBvKDxucv452unge1VTZUM/1Sr8Q+emcOo5Br8XE/fxoXdI2ofXcQa7UJlGkyGjZhgLLklhaDzgCpsLQ8+3N30F2Q1KJu95hbs0VL4w2kJQ209teHMp5qglAwssWPlV8o7E+WN7FBCJWjjYdieJXdDf/Z/tSzPE= Received: by 10.114.130.1 with SMTP id c1mr983459wad.1178894804830; Fri, 11 May 2007 07:46:44 -0700 (PDT) Received: by 10.114.183.4 with HTTP; Fri, 11 May 2007 07:46:44 -0700 (PDT) Message-ID: Date: Fri, 11 May 2007 16:46:44 +0200 From: "Nicolas Pouillard" To: "Jon Harrop" Subject: Re: [Caml-list] Custom operators in the revised syntax Cc: caml-list@yquem.inria.fr In-Reply-To: <200705111537.32561.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1884660607.20070511161455@moldavcable.com> <6f9f8f4a0705110715l48259b8cr11f22d333ed8d7f5@mail.gmail.com> <200705111537.32561.jon@ffconsultancy.com> X-j-chkmail-Score: MSGID : 464481D5.006 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 464481D5.006 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 syntax:01 quaternions:01 vectors:01 matrices:01 overloading:01 overloading:01 ocaml:01 smoke:98 wrote:01 wrote:01 caml-list:01 symbolic:01 ints:01 nums:01 On 5/11/07, Jon Harrop wrote: > On Friday 11 May 2007 15:15, Loup Vaillant wrote: > > I tend to agree when one says custom operators are evil. However, when > > the default syntax uses operators, the custom ones are a net win : a > > wise programmer will use their semantic load carefully (big nums, for > > example) > > Ints, nats, floats, complexes, quaternions, column and row vectors, matrices, > tensors, inner and outer products, symbolic expressions... This is why I like > operator overloading. > > For example, Smoke has the multiplications: * (int), *. (float), *| (vector > scaling), *|| (matrix-vector transform) and *||| (matrix-matrix multiply). > > Operator overloading and template metaprogramming were the only things I > missed moving from C++ to OCaml. :-) But having these custom operators reduce the pain, right? -- Nicolas Pouillard who also likes overloading and meta-programming....