From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 2E62D7FD5B for ; Wed, 2 Dec 2015 19:59:21 +0100 (CET) IronPort-PHdr: 9a23:g4RKkRLSMEH7Orcwg9mcpTZWNBhigK39O0sv0rFitYgULfTxwZ3uMQTl6Ol3ixeRBMOAu6wC07KempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRMiK14ye7KObxd76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtLYqySlbuuog+shcSu26Ov1gFf0LRAghZkc+7cjv/TzKTA+O4HRUdmQNjlIcCAHA6FT+X4ztmir8rOt0nieAa57YV7cxDA++5qFqUxvhlm8uLSI09WLWjIQkhbhHrReiphpXzIvdYYXTP/17KPCONegGTHZMC54CHxdKBZmxOs5WV7IM Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=artemkin@gmail.com; spf=Pass smtp.mailfrom=artemkin@gmail.com; spf=None smtp.helo=postmaster@mail-lf0-f46.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of artemkin@gmail.com) identity=pra; client-ip=209.85.215.46; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="artemkin@gmail.com"; x-sender="artemkin@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of artemkin@gmail.com designates 209.85.215.46 as permitted sender) identity=mailfrom; client-ip=209.85.215.46; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="artemkin@gmail.com"; x-sender="artemkin@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-lf0-f46.google.com) identity=helo; client-ip=209.85.215.46; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="artemkin@gmail.com"; x-sender="postmaster@mail-lf0-f46.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AIAAAkPl9Wmy7XVdFehA1uBoMpqzSFCIweI4UhghUHPBABAQEBAQEBARABAQEBAQYLCwkhLoItgiARHQEbHgMSCQEGIhUCJAERAQUBIjWHdwEDEg2fB4IIgTE+MYtIgWqCeYcDChknDVaEFgEFDpBdgl2BRAWOG4Rcg2qBBIQpiA+CJJh8EiSBFziCAVGBYjk0hW8BAQE X-IPAS-Result: A0AIAAAkPl9Wmy7XVdFehA1uBoMpqzSFCIweI4UhghUHPBABAQEBAQEBARABAQEBAQYLCwkhLoItgiARHQEbHgMSCQEGIhUCJAERAQUBIjWHdwEDEg2fB4IIgTE+MYtIgWqCeYcDChknDVaEFgEFDpBdgl2BRAWOG4Rcg2qBBIQpiA+CJJh8EiSBFziCAVGBYjk0hW8BAQE X-IronPort-AV: E=Sophos;i="5.20,374,1444687200"; d="scan'208";a="190144224" Received: from mail-lf0-f46.google.com ([209.85.215.46]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 02 Dec 2015 19:59:20 +0100 Received: by lffu14 with SMTP id u14so63293855lff.1 for ; Wed, 02 Dec 2015 10:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=29zTlLY+drp6L0jI+16uKi7NXy8jlco22JyEgdvJq8w=; b=DJ+0cA3aFvLA+TdwlZPwI5JttEGirsPS9QnVZUdNfej2P+6ZrzNk61s0F+yz1TBU4v Tbzm/g1ZD+IWKtbSgw0I8vs3Svoy9M58ZjDrVhcXRbvjBvcCVzuSqk3TIjZklwbtdqk3 ACto7o75BrthNh0z47PWNaJ83fd+ZrbBn7l4fhU0mHyZAsd4vC52GNClln/4Jt43/5kc 6w+2q2LgrBh5P59WfbKWm0lULxzh8Q/pyB4F5al1YEoen15W880bc1B71/Ttj6s2lPLY yf6nw6XGrbT75wXNIYxhqJCZzOC8NGdiPUgtOcaTXD3DbU/w0N5nsoRNGw1FEgIxSOlq fe8Q== MIME-Version: 1.0 X-Received: by 10.112.138.10 with SMTP id qm10mr3555224lbb.139.1449082759799; Wed, 02 Dec 2015 10:59:19 -0800 (PST) Received: by 10.113.3.70 with HTTP; Wed, 2 Dec 2015 10:59:19 -0800 (PST) Date: Wed, 2 Dec 2015 22:59:19 +0400 Message-ID: From: Stanislav Artemkin To: Ocaml Mailing List Content-Type: multipart/alternative; boundary=089e011615a025edc50525eedf1a Subject: [Caml-list] Unary negation parsing --089e011615a025edc50525eedf1a Content-Type: text/plain; charset=UTF-8 Hi all, I've just stumbled upon yet another question about unary negation parsing ( http://stackoverflow.com/questions/34044873/passing-negative-integer-to-a-function-in-ocaml ): let f x = x + 1 in f -1 is not valid in OCaml. I'm just wondering why this issue is still not addressed in the parser? For example, F# parses "f -1" as unary negation, but "f - 1" and "f-1" as binary operator. It looks a bit tricky (as whitespace is taken into account), but feels so natural when writing code. Is there any reason we can't have the same in OCaml? PS. I understand that it may break existing code, but it should be solvable by a compiler option similar to -safe-string etc. Thank you --089e011615a025edc50525eedf1a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

I've just stumbled upon yet= another question about unary negation parsing (