From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 052E4BC57 for ; Tue, 25 May 2010 09:28:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvUBAGYY+0tKfVI2mGdsb2JhbACdcggVAQEBAQEICQwHESKscYIBhUkuiE8BAQMFhQ4E X-IronPort-AV: E=Sophos;i="4.53,297,1272837600"; d="scan'208";a="51152355" Received: from mail-ww0-f54.google.com ([74.125.82.54]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 May 2010 09:28:23 +0200 Received: by wwb28 with SMTP id 28so932310wwb.27 for ; Tue, 25 May 2010 00:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=bhel0aZ/vM91K4kRpb7XFHHKy8K3I9GwHHpPK3LOxUE=; b=LhZH5jGWkE5jQ7BfhZr8djDzrzyWZTr4ZoQoJ4JwLf2fyIaHqygHwLe9muP+1FW2oH rY+UUJOcjsifQnTUo5YkzkDfgDuZIkR3+bvz9BtnTxxfH0Hb55ud+7O99yscK+UIftTi GnyDha7MGMCUTOjfj8BYNOAdVQWb6QsCDiliU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ApSV7swgtuAvVISCO4WH/BCF2VXsdGNItcWSX1flyDkpc1+z/6RdcJoY+bXg88hQ8D c0aOlrzRdqVtltZv1/iPnsm9kJSKAxj3xSkuT3d9aQvQxGvrj0+a/FVn2rtiNa5pWqYx AK6yRIH8nvXqGZ+lKOIZeJcXFHMftPUCs+9aA= MIME-Version: 1.0 Received: by 10.216.165.75 with SMTP id d53mr3805815wel.76.1274772503405; Tue, 25 May 2010 00:28:23 -0700 (PDT) Received: by 10.216.46.199 with HTTP; Tue, 25 May 2010 00:28:23 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 May 2010 09:28:23 +0200 Message-ID: Subject: Re: [Caml-list] Two Different Exception Behaviors in camlp4 on the toplevel From: blue storm To: Joseph Young Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; camlp:01 toplevel:01 ocaml:01 storm:98 encode:01 exception:01 caml-list:01 caml:02 caml:02 essentially:02 blue:96 static:03 types:05 enforce:05 wich:05 In case you're interested in more sophisticated examples of the DSL + phantom types combination, I've worked on [Macaque] wich is a SQL DSL for Caml using essentially the same technique. We were able to encode useful properties of the SQL values, such as nullability, in the OCaml type system. The translation from the DSL to the caml code is not always direct, because in some case you want to generate elaborate source terms wich use the type system to enforce static guarantees (eg. correcteness of the GROUP BY clauses). [Macaque] http://macaque.forge.ocamlcore.org/