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=2.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 8E5ADBBC4 for ; Wed, 15 Apr 2009 23:22:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQBAFDt5UnRVdykimdsb2JhbACVWz8BAQEKCQwHDwWqbJBLAQMBA4N7BoYp X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="27754645" Received: from mail-fx0-f164.google.com ([209.85.220.164]) by mail1-smtp-roc.national.inria.fr with ESMTP; 15 Apr 2009 23:22:37 +0200 Received: by fxm8 with SMTP id 8so107797fxm.27 for ; Wed, 15 Apr 2009 14:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=qcdFxHD+kynpeqVPwbu6fDlaNZroUvdYivzddFW726E=; b=FFEVxBT810cQhIYCNiJFlT/0hKfH9jC/mYen5y2rFP0wkoYXFn8aJZ+RrQsZf71GAi 7c0MCR2xx54oOoa8kcT/2mdvHN5rW80GS1O7szmSC7m2cM4k5EccorcHI8KsLkGiONoH NQ6phU8Fnxh9hLOXwOdZSPTHlReol4nenY9WQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=LXKyYGA8hA1F2XeXVZ8aglpA9IDUwxctz8D46xTjusqVgUU9v30jVtGA+vxp1Mb2n+ s/givTwddtrZBj/kLFunce5oSct3M/ewqW2Q7kkrTpgz37WR4RmozOdvj2G+eTN5zEHA PWQe/BBwgEf6t9ZxSOmS/YqXk7A5s3oGKPe58= Received: by 10.86.63.5 with SMTP id l5mr486862fga.63.1239830557068; Wed, 15 Apr 2009 14:22:37 -0700 (PDT) Received: from ?192.168.1.34? (18-21.78-83.cust.bluewin.ch [83.78.21.18]) by mx.google.com with ESMTPS id d6sm363786fga.2.2009.04.15.14.22.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Apr 2009 14:22:36 -0700 (PDT) Sender: =?UTF-8?Q?Daniel_B=C3=BCnzli?= Cc: caml-list@yquem.inria.fr Message-Id: <8A16D392-8DE1-4D34-8AE8-C430270B56E5@erratique.ch> From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= To: Andrey Riabushenko In-Reply-To: <200904152341.28121.cdome@bk.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [Caml-list] Functional unparsing Date: Wed, 15 Apr 2009 23:21:36 +0200 References: <200904152341.28121.cdome@bk.ru> X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; bunzli:01 buenzli:01 unparsing:01 unparsing:01 combinators:01 syntax:01 danvy's:01 brics:01 12.:98 abstract:01 caml-list:01 caml-list:01 strings:01 strings:01 linear:02 Le 15 avr. 09 =E0 22:41, Andrey Riabushenko a =E9crit : > Something like that: > > Stats.linear_regression "y ~ x1 exp(x2) log(x3) x3^2" > Returns float -> float -> float -> float -> regression_result =3D = It won't work with control strings as plain strings -- what would the =20= type of Stats.linear_regression be ? Functional unparsing solves the =20 problem by using values of a particular type and combinators to =20 represent the control string (you can actually see it as directly =20 manipulating the abstract syntax tree of the corresponding control =20 string). Have a look at Olivier Danvy's paper [1]. You may also be interested =20 in language embedding in general, see this message [2] for a reference =20= and an example. Best, Daniel [1] http://www.brics.dk/RS/98/12/BRICS-RS-98-12.pdf [2] = http://caml.inria.fr/pub/ml-archives/caml-list/2008/03/8bc5f07678134c77037= c1a2feedd4d90.en.html=