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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6F8D4BC57 for ; Sat, 23 Oct 2010 01:43:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmYHAJ6+wUxii1tPZWdsb2JhbACiBA0KCQcRJL42hUoEhFaIew X-IronPort-AV: E=Sophos;i="4.58,225,1286143200"; d="scan'208";a="75171366" Received: from nm9.bullet.mail.sp2.yahoo.com ([98.139.91.79]) by mail2-smtp-roc.national.inria.fr with SMTP; 23 Oct 2010 01:43:48 +0200 Received: from [98.139.91.67] by nm9.bullet.mail.sp2.yahoo.com with NNFMP; 22 Oct 2010 23:43:46 -0000 Received: from [98.139.91.52] by tm7.bullet.mail.sp2.yahoo.com with NNFMP; 22 Oct 2010 23:43:46 -0000 Received: from [127.0.0.1] by omp1052.mail.sp2.yahoo.com with NNFMP; 22 Oct 2010 23:43:46 -0000 X-Yahoo-Newman-Id: 254439.36735.bm@omp1052.mail.sp2.yahoo.com Received: (qmail 13121 invoked from network); 22 Oct 2010 23:43:46 -0000 Received: from 172.16.1.34 (norm@75.37.13.224 with plain) by smtp128.sbc.mail.sp1.yahoo.com with SMTP; 22 Oct 2010 16:43:45 -0700 PDT X-Yahoo-SMTP: 6wM9MhqswBCJxy9jDcYebttHhXX021oP4RUg3aXahuvJwcSQLA-- X-YMail-OSG: PrXPcLIVM1kCmM65_vtkCllGT8QTcDWkKpZaY5e75w8Kr2S uu9lBssDX1de9yTYwiFCmmT6lZRizFS8Em4M7d.v6.4n9DmTcOVMHCPq_iOR OvBwC9kMQyCYchXgdpTb.Eq7hfv2kqf1bFn1BlCbTzYyFmivwW6aSeTbTBw3 gGphr_dCzZG0emDgSPiLIK02Hq2y7lUfWEzwInPeH1fTtpI9FZw6dHqavlpK F29OhxybAJYLfnynB0uyGZNWitA4sFhUbCmRO4pW1pOjtQGnM7V9VmB4WELt cUefQ.9yswF0pnJ.yrPTcza8- X-Yahoo-Newman-Property: ymail-3 References: <20101022165950.13786wcej1xp31eu@webmail.in-berlin.de> In-Reply-To: <20101022165950.13786wcej1xp31eu@webmail.in-berlin.de> Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=windows-1252 Message-Id: <02EDD7B5-BB14-4A51-878F-D3020C7B5FE7@cap-lore.com> Content-Transfer-Encoding: quoted-printable Cc: caml-list@yquem.inria.fr From: Norman Hardy Subject: Re: [Caml-list] Typesystem and Parsers Date: Fri, 22 Oct 2010 16:43:46 -0700 To: Oliver Bandel X-Mailer: Apple Mail (2.1081) X-Spam: no; 0.00; parsers:01 bandel:01 arranging:01 parser:01 ocamlyacc:01 syntax:01 ocaml:01 ocaml:01 glass:98 lexical:01 wrote:01 oliver:01 syntactic:01 parsing:01 caml-list:01 On 2010 Oct 22, at 7:59 , Oliver Bandel wrote: > Also with arranging a parser (e.g. with ocamlyacc) both ways can be = walked along, either by just accepting everything and build up the tree, = and later detect erros in syntax or type... (for example all scanned = entities given back as strings or string lists)... Let me describe an advantage that I see for Scheme over OCaml which = pushes in the opposite direction to your proposal. Analyzing a Scheme program such as (let ( ... (r ...) ...) ...) where = the ellipses may be pages of code, I can put the cursor just to the = right of the r and type splat B twice on at least the Mac and learn the = scope of r. There are few more frequent steps for me as I study Scheme code. Any of several editors that are not Scheme savvy can do this and even = the Mac's Terminal program (a glass TTY for the shell) knows this trick. I miss this in OCaml. Perhaps this is because the gross parsing of Scheme is carried out at = the lexical level=97parentheses first! As I reason about the scope of an OCaml variable, the whole cache of = program logic in my head is flushed! And them I am not sure of the result. A systematic algorithm to determine scope is complex and error prone. I want simple syntactic rules to determine scope, rules that fairly = general editors can help with.=