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 A19CFBC69 for ; Tue, 27 Mar 2007 15:44:18 +0200 (CEST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2RDiHvA020923 for ; Tue, 27 Mar 2007 15:44:18 +0200 Received: by an-out-0708.google.com with SMTP id c24so2368501ana for ; Tue, 27 Mar 2007 06:44:17 -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:mime-version:content-type:content-transfer-encoding:content-disposition; b=ZdYHQjUTxWlTXYlMa+pyvhJ/TUR//gPInKxA1e5JYKAR/NOXuHYjD4HTNBsxejBZ3Vy8cPdN52FFp5vteHhju5wE8uGM6Kux9I2DT+t7464YOqlrwUQdcDj3l81OdR+h1JpV0q+93McxYZmvq63XTGvSrgzduYzf51EHwXDE10c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=TJo2BIW3yQV0rpynEZKInan9p7SGfLT4DVDq135g/vkTTnqCs3YwuJQ3PQ9GeyOu/ecuRBMGFzxGLkrcEUH8hasHK1OvRHSEXbs9z1fnTm9k2seVZy3TOaiXjlMY9/1P9oLv7FWAB72R90KH8kVKgEY2VgUgVdFDCf0k9pOGJAM= Received: by 10.100.164.14 with SMTP id m14mr5888827ane.1175003056726; Tue, 27 Mar 2007 06:44:16 -0700 (PDT) Received: by 10.100.111.13 with HTTP; Tue, 27 Mar 2007 06:44:16 -0700 (PDT) Message-ID: <6f9f8f4a0703270644r52490af8ieeedb8f474b95f8e@mail.gmail.com> Date: Tue, 27 Mar 2007 15:44:16 +0200 From: "Loup Vaillant" To: caml-list@yquem.inria.fr Subject: Misunderstandings about the AST MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-j-chkmail-Score: MSGID : 46091FB1.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46091FB1.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 ocaml:01 ocaml-:01 parsing:01 parsetree:01 mli:01 constructors:01 desc:01 pexp:01 pexp:01 longident:01 bool:01 longident:01 setinstvar:01 setinstvar:01 Good afternoon, Pursuing my goal of making a lisp syntax for Ocaml, I began to take a close look at the AST (Ocaml-3.09.3/parsing/parsetree.mli). I don't understand some of the constructors in the type expression_desc: | Pexp_function of label * expression option * (pattern * expression) list What is the "expression option" for? | Pexp_construct of Longident.t * expression option * bool What is the boolean for? | Pexp_variant of label * expression option What is a "variant"? (Does not seem to be related to variant types, as "Pexp_construct" is used for them) | Pexp_record of (Longident.t * expression) list * expression option What is the "expression option" for? | Pexp_constraint of expression * core_type option * core_type option Why two "core_type option", instead of just a "core_type"? | Pexp_when of expression * expression Why not "pattern * expression"? | Pexp_send of expression * string What does "Pexp_send" stand for? | Pexp_new of Longident.t What does "Pexp_new" stand for? | Pexp_setinstvar of string * expression What does "Pexp_setinstvar" stand for? | Pexp_override of (string * expression) list What does "Pexp_override" stand for? | Pexp_lazy of expression Why does this constructor even exist? Are some specific optimizations made? | Pexp_poly of expression * core_type option What does "Pexp_poly" stand for? Phew, I am done, for now. Except one question: is the AST likely to change, or else is it likely to be standardized (so any freak like me can try her fancy syntax)?. By the way, I would like to see documentation about the AST (or other related part of Ocaml's implementation). The sources are great, and highly readable, but I am afraid of hitting a wall. Thanks Loup