English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Typesystem and Parsers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-10-22 (23:43)
From: Norman Hardy <norm@c...>
Subject: Re: [Caml-list] Typesystem and Parsers

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—parentheses 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.