Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe Raffalli <raffalli@cs.chalmers.se>
To: Xavier.Leroy@inria.fr
Cc: caml-light@pauillac.inria.fr, caml-list@pauillac.inria.fr
Subject: Re: Caml Special Light 1.07
Date: Thu, 28 Sep 1995 16:33:03 +0100	[thread overview]
Message-ID: <199509281533.QAA02288@muppet42.cs.chalmers.se> (raw)
In-Reply-To: <199509281510.QAA05926@pauillac.inria.fr> (message from Xavier Leroy on Thu, 28 Sep 1995 16:10:02 +0100 (MET))


>>   - where rec a disparu ?

> Exact. "where" aussi, d'ailleurs. Redondant avec "let" et "let rec".

J'aimerai bien qu'il revienne : cela rend souvent le code plus agreable a
lire. mais peu-etre qu'il faudrait ajouter un "do" "end"

  do .... where [rec] .... end

car le scope de where etait un peu embetant a manipuler.

>>   - fun ne marche qu'avec une seul cas de matching ?

> Il suffit d'ecrire a la place:
>
>        let f x y z =
>          match (x,y,z) with
>            (..., ..., ...) ->
>          | (..., ..., ...) ->
>
>C'est aussi efficace que le "fun" a plusieurs cas en Caml Light: le
>compilateur Caml Special Light n'alloue pas le n-uplet (x,y,z).

Si c'est aussi efficace, il serait utile que le tool convert fasse cette
transformation automatiquement (meme pour les fun a un seul cas).

>>    Mais alors pourquoi ne pas ecrire les
>>    constructeurs a plus d'un argument sous forme "uncurried"
>
>Ca devient une question de syntaxe uniquement.

Cela aiderait a eliminer la confusion entre 
        type b = B of int * int         (2 arguments entiers)
        type b = B of (int * int)       (1 argument qui est une paire)

De plus ca faciliterait le portage des programmes caml-light :

on pourrait ecrire        
       type b = B of int & int    pour B avec deux arguments 
                                 (le & est un choix arbitraire... )
et
       type b = B of int * int  pour B avec un seul argument

Ainsi les vieux programmes caml-light tournerait (avec une perte d'efficacite)
sans que l'on ait a modifier les matchings du genre "B c -> ..."

>>    (et aussi pouquoi
>>    ne pas autoriser l'application partielle d'un constructeur) ?
>
>Je ne sais pas si ca servirait tres souvent.

J'appelle souvent map ou it_list avec un constructeur partiellement ou
pas du tout applique, et c'est un peu penible d'avoir a ecrire (fun x -> B x)
a la place de B ! Bien sur cela est loin d'etre important !

Christophe.

PS: for the parser problem, I just realised that $1 in a semantic-action could
be a function and So i could rewrite my parser quite easely with camlyacc
which therefore is not only a context-free parser !





      reply	other threads:[~1995-09-29  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-09-20 15:05 Xavier Leroy
1995-09-27 13:05 ` Christophe Raffalli
1995-09-28 15:10   ` Xavier Leroy
1995-09-28 15:33     ` Christophe Raffalli [this message]

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=199509281533.QAA02288@muppet42.cs.chalmers.se \
    --to=raffalli@cs.chalmers.se \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-light@pauillac.inria.fr \
    --cc=caml-list@pauillac.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