From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id DC59582355 for ; Sun, 10 Dec 2017 19:12:11 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=robert.muller2@gmail.com; spf=Pass smtp.mailfrom=robert.muller2@gmail.com; spf=None smtp.helo=postmaster@mail-oi0-f47.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of robert.muller2@gmail.com) identity=pra; client-ip=209.85.218.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="robert.muller2@gmail.com"; x-sender="robert.muller2@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of robert.muller2@gmail.com designates 209.85.218.47 as permitted sender) identity=mailfrom; client-ip=209.85.218.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="robert.muller2@gmail.com"; x-sender="robert.muller2@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oi0-f47.google.com) identity=helo; client-ip=209.85.218.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="robert.muller2@gmail.com"; x-sender="postmaster@mail-oi0-f47.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AAgqXvRzYzRzyGIzXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?0eoTIJqq85mqBkHD//Il1AaPBtqLra8cw8Pt8IneGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2TxTor3az9T8fHAnkfUow?= =?us-ascii?q?f7ytW92as8Pi8Ou7/pmbRgxJgDu7bvtWLQ6q5VHav8wSxI9jMboZyx3To3IOdf?= =?us-ascii?q?4Alk1yIlfGpRH2692stLt+9yBdobp17clKXL/mOaElSbhVFm4OPGU85cmtvh7G?= =?us-ascii?q?G1jcrkAAW3kbx0IbSzPO6wv3C9Ko6nP3?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DlAgD2dy1ahi/aVdFbHgEGDINlAYEyJ?= =?us-ascii?q?weDe4E2l2eLZodYh2AKihUHQxQBAQEBAQEBAQEBEgEBAQgLCwgoL4I4BQEeAQW?= =?us-ascii?q?CagQZARseAxIDBgEGNwIkAREBBQEiJ4l7AQMViSGNV4NFQIwQgW0YBQEcgwoFg?= =?us-ascii?q?1cKGScNWYJ3AgYSg1aCC4ZqiDSCYwWBLQGJNIhBj2wCgWGTQJNjlkoUBR+BFza?= =?us-ascii?q?BcTIaI4EBUoElgkMfghEjN4gMgVkBAQE?= X-IPAS-Result: =?us-ascii?q?A0DlAgD2dy1ahi/aVdFbHgEGDINlAYEyJweDe4E2l2eLZod?= =?us-ascii?q?Yh2AKihUHQxQBAQEBAQEBAQEBEgEBAQgLCwgoL4I4BQEeAQWCagQZARseAxIDB?= =?us-ascii?q?gEGNwIkAREBBQEiJ4l7AQMViSGNV4NFQIwQgW0YBQEcgwoFg1cKGScNWYJ3AgY?= =?us-ascii?q?Sg1aCC4ZqiDSCYwWBLQGJNIhBj2wCgWGTQJNjlkoUBR+BFzaBcTIaI4EBUoElg?= =?us-ascii?q?kMfghEjN4gMgVkBAQE?= X-IronPort-AV: E=Sophos;i="5.45,389,1508796000"; d="scan'208,217";a="304814534" Received: from mail-oi0-f47.google.com ([209.85.218.47]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Dec 2017 19:12:10 +0100 Received: by mail-oi0-f47.google.com with SMTP id t78so10231302oie.8 for ; Sun, 10 Dec 2017 10:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ar2PHF7KUOMPbcJc4imZeeCU5/pWInHmoIGmu2ZeOfc=; b=A1Q9cibaITKR+BQX4TiMvwcFu8/ZGsIrNJJGgZvehGO0y/wrKq3Q7pzDzMu+ObBRtR Wrpts/j+23GEinDF+ROyI9jR2tw0loWtTD8Wsv2LS8+yxsFE8TuWyn3SqDvT1urZfGlL 1QOfgZD5SxQpvJPUGQ9Ny5dfGRWc3tj+4qpAcENpzBMNdAF4tAk2lEFJRFQqxFA0X/G5 KucmB5yZGA73x0glwxjv+za29ETVYejoAUab7X3pT1wbTdei1tYRgPmKw71exJ26VkhV sx5D27brNL+Llorw0x0jP5/JKyUdidzzTuf7lNcfdiP46ynU5alqeHQd0XZrTxYfmCxI G8/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ar2PHF7KUOMPbcJc4imZeeCU5/pWInHmoIGmu2ZeOfc=; b=JEL9eb8VS9j365m26FtNgF8RRy4Guvoj6EdG4GsSR2a8T8/xVZu3yNGW1tr+czzZf9 64OzMb/jnt48RUpYTDOAsGJt3AQCmkCVT3w0kePl9646x7WYDeCpoZADpFdOsrDmZNFq w2+SkXuhfzcg+Beghej18kUi0cvXMKFOVNlw/ElftrgKpiG0eP1K2orYF/1tsXW+1EBG 6nNJ+mJvL1aNQzI8YfChFauv8BQsXbyJw6qp37tPCLp2W5QxKmU6CUSmHlvAeMOXC/wB wk8eFu4WvHEjVcNJjKUpwAunUU6JOnSAPKLFxKrPeG6ym/dUayK0AfDbgiodOKk+GITR iQ8A== X-Gm-Message-State: AJaThX6vag4foqyvHdLjCKb0GKIHd2FRrdCeEmqhlBJwPNBsQlWkBdTE QmdKMZwuSoV2t7xy2Qj0oLnMjSPKb4SRugkpdc8= X-Google-Smtp-Source: AGs4zMaLktdznQOW5u2I52Xnn5J6/g/sPwhAej8r+BBosI43Gfsoeyt/IBoEIggNv1rdUQMlZmGuha/pNeQXSgXKD1k= X-Received: by 10.202.75.130 with SMTP id y124mr30409965oia.91.1512929529033; Sun, 10 Dec 2017 10:12:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.171.201 with HTTP; Sun, 10 Dec 2017 10:12:08 -0800 (PST) From: Robert Muller Date: Sun, 10 Dec 2017 13:12:08 -0500 Message-ID: To: Ocaml Mailing List Content-Type: multipart/alternative; boundary="001a1134e17e25fa850560005b62" Subject: [Caml-list] ReasonML concrete syntax --001a1134e17e25fa850560005b62 Content-Type: text/plain; charset="UTF-8" The team developing ReasonML seems to be experimenting with concrete syntax in an effort to make it feel as familiar and natural as possible to JavaScript programmers. Seems like a good idea. But the present version seems to hardwire parentheses awkwardly for function definitions and calls. Parentheses are required for both function definitions and calls. So one writes let incr(n) = n + 1 and incr(5) but not let incr n = n + 1 or incr 5 Fair enough, but for multi-argument functions the parser seems to unroll the parenthesized items (both parameters & arguments) to leave curried functions. E.g., let add(m, n) = m + n or equivalently let add = (m, n) => m + n then add(5, 3) is 8 as one would expect. But the (m, n) in let add(m, n) = ... isn't a pattern matching a pair, it's the JS-style sequence of input parameters and the definition unrolls to let add = (m) => (n) => ... . So add(5) : int -> int and all three of add(5, 3), add(5)(3) and { let add5 = add(5); add5(3) } are 8. There's probably a way to write an add function of type int * int -> int, but I don't know how to write it. I'm wondering what the OCaml community makes of this. I find it awkward. Bob Muller --001a1134e17e25fa850560005b62 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The team developing ReasonML seems to be experimenting wit= h concrete syntax in an effort to make it feel as familiar and natural as p= ossible to JavaScript programmers. Seems like a good idea. But the present = version seems to hardwire parentheses awkwardly for function definitions an= d calls. Parentheses are required for both function definitions and calls. = So one writes

let incr(n) =3D n + 1=C2=A0 =C2=A0 = =C2=A0 =C2=A0and=C2=A0 =C2=A0incr(5)

but not
=

let incr n =3D n + 1=C2=A0 =C2=A0 =C2=A0 =C2=A0 or=C2= =A0 =C2=A0 incr 5

Fair enough, but for multi-argum= ent functions the parser seems to unroll the parenthesized items (both para= meters & arguments) to leave curried functions. E.g.,

let add(m, n) =3D m + n=C2=A0 or equivalently let add =3D (m, n) = =3D> m + n

then add(5, 3) is 8 as one would exp= ect. But the (m, n) in let add(m, n) =3D ... isn't a pattern matching a= pair, it's the JS-style sequence of input parameters and the definitio= n unrolls to let add =3D (m) =3D> (n) =3D> ... . So add(5) : int ->= ; int and all three of add(5, 3), add(5)(3) and { let add5 =3D add(5);=C2= =A0 add5(3) } are 8. There's probably a way to write an add function of= type int * int -> int, but I don't know how to write it.

I'm wondering what the OCaml community makes of th= is. I find it awkward.
Bob Muller


--001a1134e17e25fa850560005b62--