caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Marc EBER <Jean-Marc.Eber@socgen.com>
To: caml-list <caml-list@inria.fr> (IPM Return requested)
Subject: OCaml syntax: vertcal bar in front of the first case of a matching definition ?
Date: 03 Feb 2000 10:39:25 +0100	[thread overview]
Message-ID: <0233238994CCD058*/c=FR/admd=ATLAS/prmd=SG/o=INFI/s=EBER/g=JEAN-MARC/@MHS> (raw)

Petite question/remarque sur la syntaxe de OCaml 2.04 :

Je trouve, personnellement, déroutant le fait qu'il soit permis, mais
non obligatoire, de placer une barre verticale (|) devant le *premier*
filtrage d'une définition de fonction (resp d'un match). 
Il semble que ce soit là un reliquat du passé, et que la barre soit
devenue un *préfixe* de cas après avoir été un *séparateur* de cas.

L'obligation de placer une telle barre devant chaque cas me semble plus =
claire à la lecture et provoquerait une uniformisation des codes OCaml =
disponibles.

Intuitivement, je pense aussi qu'une telle obligation devrait simplifier=
 grandement le travail d'analyse et de formatage des modes emacs, gr=E2c=
e à un point de synchronisation supplémentaire.

Je constate que le source de OCaml est presque exclusivement en vieux mod=
e, sans barre devant le premier filtrage.

Idée : le passage de 2.04 -> 2.99 (resp 3.0) exige de toute façon une=
 transformation du source, ne serait-ce que pour ajouter certains espaces=
, nécessaires pour éviter des ambiguités avec des labels, si j'ai =
bien compris. Ne serait-ce pas le moment idéal pour rajouter cette barr=
e verticale lorsqu'elle manque et la rendre obligatoire dans OCaml 3.00 =
?


Quick English translation :
About the syntax of OCaml 2.04.

It is allowed but not mandatory to put a vertical bar (|) in front of the=
 first case of a matching definition. This freedom seems to exist for leg=
acy code support (especially OCaml source itself).

I suggest to impose a vertical bar also in front of the first case for ev=
ident clarity reasons.

This should also make easier the work of the emacs mode formatters.

If I understand well, the migration 2.04 -> 2.99 (3.00) imposes a use of =
a code reformatter, because at least some spaces have to be added, for av=
oiding some clashes with labels. Wouldn't this be the right moment for a=
dding automatically such a bar and then make it mandatory in 3.00 ?


Jean-Marc Eber

Société Générale
Infi/Dir
17, cours Valmy, F 92 987 Paris - La Défense Cedex
Tél +33 1 42 13 65 30  Fax: +33 1 42 13 60 78
EMail: jean-marc.eber@socgen.com
*************************************************************************

Ce message et toutes les pièces jointes (ci-après le "message") sont
confidentiels et établis à l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisée est interdite.
Tout message électronique est susceptible d'altération.
La SOCIETE GENERALE et ses filiales déclinent toute responsabilité 
au titre de ce message s'il a été altéré, déformé ou falsifié.

				********

This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall 
be liable for the message if altered, changed or falsified.

*************************************************************************



                 reply	other threads:[~2000-02-04  7:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='0233238994CCD058*/c=FR/admd=ATLAS/prmd=SG/o=INFI/s=EBER/g=JEAN-MARC/@MHS' \
    --to=jean-marc.eber@socgen.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).