Message from discussion
A few questions
Received: by 10.68.231.138 with SMTP id tg10mr16162611pbc.7.1332673912718;
Sun, 25 Mar 2012 04:11:52 -0700 (PDT)
X-BeenThere: elixir-lang-core@googlegroups.com
Received: by 10.68.225.129 with SMTP id rk1ls10912402pbc.5.gmail; Sun, 25 Mar
2012 04:11:52 -0700 (PDT)
Received: by 10.68.125.233 with SMTP id mt9mr16196698pbb.5.1332673912539;
Sun, 25 Mar 2012 04:11:52 -0700 (PDT)
Received: by 10.68.125.233 with SMTP id mt9mr16196697pbb.5.1332673912524;
Sun, 25 Mar 2012 04:11:52 -0700 (PDT)
Return-Path: <jose.va...@gmail.com>
Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43])
by gmr-mx.google.com with ESMTPS id e6si13307678pbt.1.2012.03.25.04.11.52
(version=TLSv1/SSLv3 cipher=OTHER);
Sun, 25 Mar 2012 04:11:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of jose.va...@gmail.com designates 209.85.160.43 as permitted sender) client-ip=209.85.160.43;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jose.va...@gmail.com designates 209.85.160.43 as permitted sender) smtp.mail=jose.va...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-pb0-f43.google.com with SMTP id wz12so4988994pbc.30
for <elixir-lang-core@googlegroups.com>; Sun, 25 Mar 2012 04:11:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type;
bh=0yTrNq8zAklMFQgYABIuroi1xeWAZejivdZhZG1dGRY=;
b=WYHAsDjyQ++AyBC89LnMwiBNzm2nGrCZpUsi6sJ3Jy9695EHefILHHowmE8a4RMHKD
BXCkl2zDf3s1dcYKK0RwDz0oAiNqRTCfgKnuJ566piK4SKu1YudOCqQ8z1nWh9spBnmu
lkfssZxNr+pula814Lw8gXv4z+0yiH5XekP6ZTkEosXzzV9z+8OFAbdx58r9+Ldq4tpk
R17/keIslq0oB+wo1oLzHUj46+elevduQFe7zkqIxVhi41xVLstCqRn83M3OXCaZEh0L
YHOEa16FwP8uZpxkvisnS71osWGjIl1UUWRuoC4Crmrza4PFzqMqvG5jOx7cAPV5kchv
xObA==
Received: by 10.68.231.106 with SMTP id tf10mr1559208pbc.69.1332673912212;
Sun, 25 Mar 2012 04:11:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.68.28.68 with HTTP; Sun, 25 Mar 2012 04:11:32 -0700 (PDT)
In-Reply-To: <CAAPY6ePm_XWfUA_bOSwbhJThf2kL21ZCPgTMRyqOMYeNNXL...@mail.gmail.com>
References: <d8100850-ceca-4a1d-855b-67d147981...@hs8g2000vbb.googlegroups.com>
<CAGnRm4KBkWhgD451H_G0DcU7bhCdMx938ug2fpEYLEuKYBw...@mail.gmail.com>
<478f77fd-89ac-4a86-ad5c-ff52894bf...@i2g2000vbv.googlegroups.com>
<CAGnRm4JoQVPsVeB0dDkdn0HZNWYKy2pEx8_1EC3GX-My1q5...@mail.gmail.com> <CAAPY6ePm_XWfUA_bOSwbhJThf2kL21ZCPgTMRyqOMYeNNXL...@mail.gmail.com>
From: =?ISO-8859-1?Q?Jos=E9_Valim?= <jose.va...@gmail.com>
Date: Sun, 25 Mar 2012 13:11:32 +0200
Message-ID: <CAGnRm4+mPRK7gpokA4krXXURow2No+K2+7G9NSjuW3S+czy...@mail.gmail.com>
Subject: Re: A few questions
To: elixir-lang-core@googlegroups.com
Content-Type: multipart/alternative; boundary=047d7b33d864238ae904bc0f5382
--047d7b33d864238ae904bc0f5382
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Basically you always need a dot to invoke something. But sometimes there
isn't anything between the dot and the parenthesis, because the function is
anonymous.
*
Jos=E9 Valim
www.plataformatec.com.br
Founder and Lead Developer
*
On Sun, Mar 25, 2012 at 1:02 PM, Alexei Sholik <alcosho...@gmail.com> wrote=
:
> This is one way to interpret the situation. One other way we could
>> interpret it is considering that functions are anonymous and therefore
>> don't expect a name to be given on invocation. For example, imagine we h=
ave
>> a module named List. If we want to invoke a function of that module, we
>> need to pass a name, for example, flatten:
>>
>> List.flatten([1,2,3])
>>
>> However, functions doesn't require a name to be invoked, and therefore w=
e
>> can omit the `flatten`:
>>
>> function.([1,2,3])
>>
>> So we could fit everything under named and anonymous invocation. The
>> expression flatten([1,2,3]) would be a named invocation as well, because=
it
>> is simply a shortcut to __LOCAL__.flatten([1,2,3]).
>>
>
> I don't understand the transition from "List.flatten" (which is
> MODULE_NAME.FUNCTION_NAME) to "function." (which is function.NOTHING ??).
>
>
> --
> Best regards
> Alexei Sholik
>
--047d7b33d864238ae904bc0f5382
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p class=3D"p1">Basically you always need a dot to invoke something. But so=
metimes there isn't anything between the dot and the parenthesis, becau=
se the function is anonymous.</p><div><br></div><div><br></div><span style=
=3D"font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><=
b><span style=3D"border-collapse:separate;font-family:arial;font-weight:nor=
mal"><div>
<span style=3D"font-family:arial,sans-serif;font-size:13px;border-collapse:=
collapse"><b>Jos=E9 Valim</b></span></div><div><span style=3D"font-family:a=
rial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style=
=3D"font-family:verdana,sans-serif;font-size:x-small"><a href=3D"http://www=
.plataformatec.com.br/" style=3D"color:rgb(42,93,176)" target=3D"_blank">ww=
w.plataformatec.com.br</a></span></div>
<div><span style=3D"font-family:verdana,sans-serif;font-size:x-small">Found=
er and Lead Developer</span></div></span></div></span></b></span><br>
<br><br><div class=3D"gmail_quote">On Sun, Mar 25, 2012 at 1:02 PM, Alexei =
Sholik <span dir=3D"ltr"><<a href=3D"mailto:alcosho...@gmail.com">alcosh=
o...@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=3D"gma=
il_quote"><div>This is one way to interpret the situation. One other way we=
could interpret it is considering that functions are anonymous and therefo=
re don't expect a name to be given on invocation. For example, imagine =
we have a module named List. If we want to invoke a function of that module=
, we need to pass a name, for example, flatten:</div>
<div><br></div><div>=A0 =A0 List.flatten([1,2,3])</div><div><br></div><div>=
However, functions doesn't require a name to be invoked, and therefore =
we can omit the `flatten`:</div><div><br></div><div>=A0 =A0 function.([1,2,=
3])</div>
<div><br></div><div>So we could fit everything under named and anonymous in=
vocation. The expression flatten([1,2,3]) would be a named invocation as we=
ll, because it is simply a shortcut to __LOCAL__.flatten([1,2,3]).</div>
</div></blockquote><div><br></div><div>I don't understand the transitio=
n from "List.flatten" (which is MODULE_NAME.FUNCTION_NAME) to &qu=
ot;function." (which is function.NOTHING ??).</div></div><span class=
=3D"HOEnZb"><font color=3D"#888888"><br clear=3D"all">
<div><br></div>-- <br>Best regards<br>Alexei Sholik<br>
</font></span></blockquote></div><br>
--047d7b33d864238ae904bc0f5382--