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 BB9CB7EE51 for ; Sun, 26 May 2013 00:42:12 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=pra; client-ip=192.109.42.8; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oliver@first.in-berlin.de) identity=mailfrom; client-ip=192.109.42.8; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="oliver@first.in-berlin.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@einhorn.in-berlin.de) identity=helo; client-ip=192.109.42.8; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oliver@first.in-berlin.de"; x-sender="postmaster@einhorn.in-berlin.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQBAB49oVHAbSoIlGdsb2JhbABahnO5VYUngQgWDgEBAQEJCwkJFAQkgiMBAQQBIwRSEAsJBQoCAgUhAgIPBRgxiBoGBKsPkQUWgRCNdweCQTJhA48HiDOUUg X-IPAS-Result: AnQBAB49oVHAbSoIlGdsb2JhbABahnO5VYUngQgWDgEBAQEJCwkJFAQkgiMBAQQBIwRSEAsJBQoCAgUhAgIPBRgxiBoGBKsPkQUWgRCNdweCQTJhA48HiDOUUg X-IronPort-AV: E=Sophos;i="4.87,742,1363129200"; d="scan'208";a="18980488" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 May 2013 00:42:12 +0200 X-Envelope-From: oliver@first.in-berlin.de Received: from first (e178019102.adsl.alicedsl.de [85.178.19.102]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id r4PMgAwg001840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 26 May 2013 00:42:10 +0200 Received: by first (Postfix, from userid 1000) id E658F15400DE; Sun, 26 May 2013 00:42:09 +0200 (CEST) Date: Sun, 26 May 2013 00:42:09 +0200 From: oliver To: David Allsopp Cc: Gabriel Scherer , Wojciech Meyer , Siraaj Khandkar , Arnaud Spiwack , OCaML Mailing List Message-ID: <20130525224209.GA1958@siouxsie> References: <20130523235355.GI6510@siouxsie> <20130524233015.GE1923@siouxsie> <37A1A2D3-5993-4675-9937-ED3965793D1D@khandkar.net> <20130525004045.GH1923@siouxsie> <20130525110457.GA1947@siouxsie> <20130525120455.GF1947@siouxsie> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 Subject: Re: [Caml-list] OCaml's variables On Sat, May 25, 2013 at 12:30:12PM +0000, David Allsopp wrote: > oliver wrote > > Hi, > > > > On Sat, May 25, 2013 at 01:49:46PM +0200, Gabriel Scherer wrote: > > > The name "variable" has been used for centuries by the mathematicians > > > to denote exactly names that refer to values (of course immutable > > > values, we're talking about mathematical objects her). There is no > > > point in trying to change it because some people conflate this notion > > > with mutability. > > > > Hmhhh. > > "Some" people? As far as I remember, I heard these arguments quite often. > > Some does not mean few. You appear to be trying to split hairs without a > sufficient command of English. Once upon a time I would have prefixed that > "With respect", but various Internet memes mean that most people now know what > a British person actually means when they say that ;o) The hairsplitting is built into myself - immutable property. Regarding my english language skills I have to admit, that they could be better. > > > > (When you write (x + 1), the value denoted by "x" is an unknown that > > > depends on the context/environment; in particular it may vary when > > > used in different contexts.) > > > > > > The name "variable" is also used in the expression "type variable", > > > which denotes for example the 'a in > > > val id : 'a -> 'a > > > and which is clearly not associated to any form of mutation. > > [...] > > > > Hmhhh, and what about imperative languages? > > What part did they broke? > > And why did they "misuse" the word "variable" and in which way? > > > > Is it because of mutability, which may break all these used "mathematical > > metaphors"? > > > > Can you elaborate on why "variables" are the wrong term or a 2bad" term in > > imperative languages and not in functional languages? > > There is no misuse and nothing broken - it is merely that when talking about > imperative languages the word "variable" is typically where "mutable variable" > is meant (because immutability is not usually of interest). When first teaching > functional languages to people who are probably already familiar with > imperative languages, one often chooses to eliminate the use of the word > variable. This is because it can be confusing when trying to convey how to > think functionally versus imperatively (a child's trick: if the student uses > the word variable they are probably thinking of a reference cell and hence not > functionally - so you steer the argument by "banning" the word variable from > the conversation). Once you actually have an understanding of functional > thinking, the elimination of the word variable becomes unnecessary. Aha, I see. Someone also brought in the argument of type variable. I never had a problem with this so far. I wonder, why I had a problem now with the stuff on page 136. Maybe because type variable means, it's not fixed if it's type 'a, but that a value (e.g. the recursive lists example on that page) is a non-referenced and therefore immutable value. The term for the input of a function normally is an "argument" or "parameter", but seldom called variable. Maybe thats why I stumbled over this term now. > > The OCaml Language Specification is most certainly not a document intended > for a beginner either to OCaml or functional programming - an obsessive > elimination of the word variable would likely make the text less clear to those > who will actually be reading it. OK, I see. Ciao, Oliver