From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A1E5BBC48 for ; Wed, 6 Apr 2005 07:13:49 +0200 (CEST) Received: from services.cse.ucsc.edu (services.cse.ucsc.edu [128.114.48.10]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j365Dl2R019384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 6 Apr 2005 07:13:49 +0200 Received: from localhost (kresge-37-234.resnet.ucsc.edu [169.233.37.234]) (authenticated bits=0) by services.cse.ucsc.edu (8.13.1/8.13.1) with ESMTP id j365DU5n013517 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Tue, 5 Apr 2005 22:13:30 -0700 (PDT) Date: Tue, 5 Apr 2005 22:12:53 -0700 From: Kenneth Knowles To: Geoff Wozniak Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: some comments on ocaml{lex,yacc} from a novice's POV Message-ID: <20050406051252.GA24471@tallman.ucsc.edu> References: <49464.202.164.198.46.1112355123.squirrel@www.ivorykite.com> <200504041051.07270.jon@ffconsultancy.com> <87mzsdv3gb.fsf@nagash.wacky> <200504051449.39133.jon@ffconsultancy.com> <87vf70tsk5.fsf@nagash.wacky> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vf70tsk5.fsf@nagash.wacky> User-Agent: Mutt/1.5.8i X-Miltered: at concorde with ID 4253700B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 variants:01 variants:01 prototyping:01 kenneth:98 knowles:98 wrote:01 polymorphic:01 lex:01 tree:02 objects:02 parse:02 types:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, Apr 06, 2005 at 12:52:58AM -0400, Geoff Wozniak wrote: > I was doing this in OCaml, but I found that I had to constantly create new > types to represent the different forms that could be found in the parse > tree. This sounds quite familiar. One idea is to use polymorphic variants and immediate objects instead of conventional variants and record types (though this can create some scary error messages). I've only ever done this for very rapid prototyping, though. - Kenn