From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: pcase ` meaning Date: Tue, 30 Oct 2018 09:14:41 -0400 Message-ID: References: <20151216202605.GA3752@acm.fritz.box> <87egdy8tyz.fsf@fencepost.gnu.org> <56895FDE.4060406@yandex.ru> <8760za8r4a.fsf@fencepost.gnu.org> <87h9iunkcg.fsf@web.de> <87h8hc4xw2.fsf_-_@web.de> <83tvlcsnee.fsf@gnu.org> <87pnw037ar.fsf@web.de> <83ftwvs7y9.fsf@gnu.org> <877ei7mkfh.fsf@web.de> <87a7mze7tl.fsf@web.de> <87zhuykjjh.fsf@web.de> <871s8aesdc.fsf@portable.galex-713.eu> <87tvl6dc3e.fsf_-_@portable.galex-713.eu> <87efc9isxj.fsf@web.de> <87tvl5653j.fsf@portable.galex-713.eu> <38aa830d-740e-af4d-9071-9aa0d9c10f04@gmail.com> <87efc8qnwh.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1540905442 5400 195.159.176.226 (30 Oct 2018 13:17:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 13:17:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 30 14:17:18 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHTtT-0001FG-Bw for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 14:17:15 +0100 Original-Received: from localhost ([::1]:53230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTvZ-0001YM-Ly for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 09:19:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTrB-0007Gs-Vc for emacs-devel@gnu.org; Tue, 30 Oct 2018 09:14:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHTr8-0007kS-T5 for emacs-devel@gnu.org; Tue, 30 Oct 2018 09:14:54 -0400 Original-Received: from [195.159.176.226] (port=38831 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHTr8-0007jP-L1 for emacs-devel@gnu.org; Tue, 30 Oct 2018 09:14:50 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gHToz-0004O9-3e for emacs-devel@gnu.org; Tue, 30 Oct 2018 14:12:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:HJZN0GiQhOm5kPKhMJbiJKMgkOQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230824 Archived-At: > #+BEGIN_SRC ocaml > match [1;2;3] with [a;b;c] -> [a;b;c] > #+END_SRC > > But this is a non-primordial side effect. Notice how in the later case > the matched data *always* look the same as the pattern (beside replacing > a number per an identifier): *that’s* the purpose of pattern matching. > While in the lisp case you got those extra “,”. That's for a very simple reason: OCaml doesn't have Lisp's symbols, so its [a;b;c] can't mean "a list containing the symbols a, b, and c". OCaml still has to distinguish between variables and data constructors, but instead of using a "," to distinguish the two cases, they force constructors to be capitalized. Stefan