From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: dsyme@microsoft.com Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA15258 for ; Mon, 21 Feb 2000 19:03:18 +0100 (MET) Received: from mail1.microsoft.com (mail1.microsoft.com [131.107.3.125]) by concorde.inria.fr (8.8.7/8.8.7) with SMTP id TAA06568 for ; Mon, 21 Feb 2000 19:03:17 +0100 (MET) Received: from 157.54.9.101 by mail1.microsoft.com (InterScan E-Mail VirusWall NT); Mon, 21 Feb 2000 10:03:03 -0800 (Pacific Standard Time) Received: by INET-IMC-01 with Internet Mail Service (5.5.2651.58) id ; Mon, 21 Feb 2000 10:03:02 -0800 Message-ID: <39ADCF833E74D111A2D700805F1951EF1801447B@RED-MSG-06> From: Don Syme To: "'David McClain'" , caml-redistribution@pauillac.inria.fr Subject: RE: Dichotomy between functions and type constructors? Date: Mon, 21 Feb 2000 10:02:54 -0800 X-Mailer: Internet Mail Service (5.5.2651.58) I believe it's got something to do with cross module optimization. However, I've always wondered why the restriction is not lifted at least inside the module where the constructor is declared. Cheers, Don -----Original Message----- From: David McClain [mailto:dmcclain@azstarnet.com] Sent: 21 February 2000 17:09 To: caml-redistribution@pauillac.inria.fr Subject: Dichotomy between functions and type constructors? I am curious about the apparent dichotomy between normal functions and type constructors, and why this disparity exists? Say I have a type type thing = T1 of int * float | .... I can create such a type as T1(5, 3.14) but I cannot create such a type on a tuple result of a function call: let doit x = (x, float_of_int x) let myT1 = T1(doit x) This gives rise to a type checking error wherein the constructor T1 demands two arguments, instead of demanding a tuple of two elements. SML does not appear to impose this same requirement on the programmer, so what is the origin of the OCaml requirement? TIA, David McClain, Sr. Scientist Raytheon Systems Co. Tucson, AZ