[erlang-questions] Re: Process Dictionary vs Proplist in Web Frameworks
Ngoc Dao
ngocdaothanh@REDACTED
Fri Oct 30 08:32:00 CET 2009
> What can you do with set-once variables in Erlang?
For example:
* In the controller you set-once an article in PD:
http://github.com/ngocdaothanh/khale/blob/master/removable/article/c_article.erl
* In the view you take out the article and render:
http://github.com/ngocdaothanh/khale/blob/master/removable/article/v_article_show.erl
The philosophy behind "set-once" is that you need to pass things in
only one way, from a layer to layers behind it. For this purpose PD is
a perfect medium, and its its implicitness would make the code less
verbose. As a framework developer, I think it would make for app
developers happy because their code would be less verbose.
When you want to start Eshell, would you want to type "erl" or the
full path to "erl"?
Ngoc
On Fri, Oct 30, 2009 at 4:09 PM, Max Lapshin <max.lapshin@REDACTED> wrote:
> On Fri, Oct 30, 2009 at 10:07 AM, Ngoc Dao <ngocdaothanh@REDACTED> wrote:
>> In order to intercept, I think the explicit thing you need to know is
>> the processing flow. For example:
>> browser -> yaws -> front controller -> app-wide filter ->
>> controller-wide filter -> action -> view -> layout -> front controller
>> -> yaws -> browser
>
> Damn, You look at mutable Ruby and try to implement in immutable
> Erlang the same thing.
> after_filter in Rails can modify anything, including internal hidden
> instance variables.
> What can you do with set-once variables in Erlang?
More information about the erlang-questions
mailing list