لم تعُد "مجموعات Google" تتيح المشاركات أو الاشتراكات الجديدة من Usenet. وسيبقى بالإمكان عرض المحتوى السابق.

[Caml-list] ANN: "The Whitespace Thing" for OCaml

21 مرّة مشاهدة
التخطي إلى أول رسالة غير مقروءة

Mike Lin

غير مقروءة،
21‏/11‏/2005، 5:45:57 م21‏/11‏/2005
إلى caml...@yquem.inria.fr
Hi all,

Brace yourselves for "The Whitespace Thing". This is an OCaml
preprocessor that uses your indentation to group expressions, like in
Python and Haskell. Effectively, the preprocessor auto-parenthesizes
expressions that are split over multiple lines, using your indentation
as clues. This eliminates syntax clutter such as multi-line
parenthesizations, the sequencing operators ; and ;; , and the
keywords done, end, and begin.

http://people.csail.mit.edu/mikelin/ocaml+twt/

Mike

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

David Baelde

غير مقروءة،
22‏/11‏/2005، 2:32:22 ص22‏/11‏/2005
إلى caml...@yquem.inria.fr
Nice job!

I'm especially impressed by the removal of the sequence operator, and
how you also use whitespace for multiple-lines applications.
Is it really not ambiguous ?

Thanks.
--
David

Mike Lin

غير مقروءة،
22‏/11‏/2005، 11:26:27 ص22‏/11‏/2005
إلى caml...@yquem.inria.fr
> I'm especially impressed by the removal of the sequence operator, and
> how you also use whitespace for multiple-lines applications.
> Is it really not ambiguous ?

Yes...the preprocessor uses rules such as: if an indented block
follows a let, if, try, etc., it's a sequence -- if it follows an
indentifier, then it's an application. This is sound, as far as I can
tell. There is a restriction that a multi-line expression has to start
on its own line, which lets me get away without actually building a
full AST for the source. Ideally that's how it would eventually work,
but...80/20.

Mike

0 رسالة جديدة