Message from discussion
(Non)Parametrized modules, inheritance, and R15B02 issues?
Received: by 10.204.4.211 with SMTP id 19mr1498832bks.5.1349860705988;
Wed, 10 Oct 2012 02:18:25 -0700 (PDT)
X-BeenThere: erlang-programming@googlegroups.com
Received: by 10.204.129.72 with SMTP id n8ls178941bks.0.gmail; Wed, 10 Oct
2012 02:18:25 -0700 (PDT)
Received: by 10.204.6.19 with SMTP id 19mr922743bkx.8.1349860705731;
Wed, 10 Oct 2012 02:18:25 -0700 (PDT)
Received: by 10.204.6.19 with SMTP id 19mr922742bkx.8.1349860705714;
Wed, 10 Oct 2012 02:18:25 -0700 (PDT)
Return-Path: <erlang-questions-boun...@erlang.org>
Received: from hades.cslab.ericsson.net (hades.cslab.ericsson.net. [192.121.151.104])
by gmr-mx.google.com with ESMTP id v13si88856bkw.0.2012.10.10.02.18.25;
Wed, 10 Oct 2012 02:18:25 -0700 (PDT)
Received-SPF: pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) client-ip=192.121.151.104;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of erlang-questions-boun...@erlang.org designates 192.121.151.104 as permitted sender) smtp.mail=erlang-questions-boun...@erlang.org; dkim=neutral (body hash did not verify) header...@gmail.com
Received: from hades.cslab.ericsson.net (hades [192.121.151.104])
by hades.cslab.ericsson.net (Postfix) with ESMTP id 19E8F5C114;
Wed, 10 Oct 2012 11:18:18 +0200 (CEST)
X-Original-To: erlang-questi...@erlang.org
Delivered-To: erlang-questi...@erlang.org
Received: from mail-la0-f53.google.com (mail-la0-f53.google.com
[209.85.215.53])
by hades.cslab.ericsson.net (Postfix) with ESMTP id 742225C002
for <erlang-questi...@erlang.org>; Wed, 10 Oct 2012 11:18:16 +0200 (CEST)
Received: by mail-la0-f53.google.com with SMTP id l5so198610lah.40
for <erlang-questi...@erlang.org>; Wed, 10 Oct 2012 02:18:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=subject:mime-version:content-type:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to:x-mailer;
bh=YKIfazTDrTvYU8/dBqbJ//fFkK51giAI2DcjRVVjbFg=;
b=zIrudLW4QSLO1I5BfwGsnxEWpPuL6Putksumm4p9djuKIa38kUH65XjfLzXLb6ILCt
ee5KuMFxHnLljGyuXEwfiLrjNgWzlkiABTLFI2nbFXT+RdvS2sOp8kXvdPPGkcmm4ZpL
6ZDuDeyMzvX58sVFmhTdcr3/XwgDMZciS9QUgiz43kisL3Cy0KimGA6/2HLpvgK3L9Za
JtymYyO21fFnWkxCbXfCHyU/ivKfq2jwiZcFyJwrXVPGEBkcbd6t2AmtOQN9zbEUiuOr
YhkrysZiowIfTek9ASRSXoDkOkzrayCLOQfjHHqo44DurQF2e6M2ilw8lmOebUNA+1V0
eAzA==
Received: by 10.152.103.18 with SMTP id fs18mr19297538lab.32.1349860696039;
Wed, 10 Oct 2012 02:18:16 -0700 (PDT)
Received: from ?IPv6:2a02:6b8::101:60c:ceff:fed1:7812?
([2a02:6b8:0:101:60c:ceff:fed1:7812])
by mx.google.com with ESMTPS id tr2sm257295lab.14.2012.10.10.02.18.13
(version=TLSv1/SSLv3 cipher=OTHER);
Wed, 10 Oct 2012 02:18:14 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1085)
From: Dmitry Belyaev <be.dmi...@gmail.com>
In-Reply-To: <FC0B0283-1F26-4291-97E6-E424E0FE8...@feuerlabs.com>
Date: Wed, 10 Oct 2012 13:18:08 +0400
Message-Id: <FEFF8404-D116-407D-B089-C7154922E...@gmail.com>
References: <865f8ce0-05c3-4b6e-b31d-b47724912841@zimbra>
<FC0B0283-1F26-4291-97E6-E424E0FE8...@feuerlabs.com>
To: Ulf Wiger <u...@feuerlabs.com>
X-Mailer: Apple Mail (2.1085)
Cc: Tomas Morstein <t...@idea.cz>,
"erlang-questi...@erlang.org" <erlang-questi...@erlang.org>
Subject: Re: [erlang-questions] (Non)Parametrized modules, inheritance,
and R15B02 issues?
X-BeenThere: erlang-questi...@erlang.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: General Erlang/OTP discussions <erlang-questions.erlang.org>
List-Unsubscribe: <http://erlang.org/mailman/options/erlang-questions>,
<mailto:erlang-questions-requ...@erlang.org?subject=unsubscribe>
List-Archive: <http://erlang.org/pipermail/erlang-questions>
List-Post: <mailto:erlang-questi...@erlang.org>
List-Help: <mailto:erlang-questions-requ...@erlang.org?subject=help>
List-Subscribe: <http://erlang.org/mailman/listinfo/erlang-questions>,
<mailto:erlang-questions-requ...@erlang.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: erlang-questions-boun...@erlang.org
Sender: erlang-questions-boun...@erlang.org
My opinion is that parametrized modules are very nice for abstractions.
For example like these:
https://github.com/rabbitmq/erlando#monad-transformers
Of course it is doable without pmods. But it is doable with some kind of reinventing the wheel. Do we need to have non standard way to do the same thing?
-module(my_pmod).
-export([new/2, apply/2]).
-record(my_pmod, {module, thid}).
new(Module, Params) ->
#my_pmod{module=Module, this=Params}.
apply(#my_pmod{module=Module, this=This}, Fun, Params) ->
apply(Module, Fun, Params ++ [This]).
--
Dmitry Belyaev
On 10.10.2012, at 11:10, Ulf Wiger wrote:
> What would be good is if a list of good uses of pmods could
> be collected, and honorable workarounds suggested.
>
> This could of course be done interactively on this list.
> Present what you think is code that is not easily done well
> without pmods, and let the members of this list debate
> suitable rewrites. If good alternatives are hard to find,
> maybe that could inform some EEP for a more
> 'erlangish' extension that renders pmods truly obsolete?
>
> BR,
> Ulf W
>
>
> On 10 okt 2012, at 00:54, Tomas Morstein <t...@idea.cz> wrote:
>
>>>> ...
>>
>> The problem starts when it comes to projects like ChicagoBoss
>> that we at IDEA love and intensively use every day.
>> CB uses pmods not only for simple_bridge-based web controllers,
>> but also for its sophisticated and well integrated concept of
>> data models being linked with Django templating engine in turn.
>>
>> Although I fully understand reasons why pmods and their eventual
>> pseudo-OOP behaviour (like inheritance) are not so clear as they
>> are implemented today, but in other hand, many excellent projects
>> may disappear in final result...
>>
>> I hope such a "total eclipse" is not going to happen, but our case
>> (over-using the extra unsupported and hackish features) we've just
>> adapted our technology to framework and totally forgot to standards,
>> what's in fact our own mistake.
> _______________________________________________
> erlang-questions mailing list
> erlang-questi...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions