[erlang-questions] New module syntax and semantics?

Tom Ayerst tom.ayerst@REDACTED
Sun Jun 29 22:56:53 CEST 2008


Is was looking at the mochiweb code and I saw some oddities.

firstly the module statement:
-module(mochiweb_request, [Socket, Method, RawPath, Version, Headers]).

In the use of mochiweb I can see things like Req:get(method).

This looks more like an object method call, is this new?  I cannot see an
docs about it.

Thanks for any info.

Tom Ayerst

In the example Req ={mochiweb_request,#Port<0.142>,'GET',
                                         "/",
                                         {1,1},
                                         {9,
                                          {"host",
                                           {'Host',"127.0.0.1:8888"},
                                           {"accept",
                                            {'Accept',

"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
                                            nil,
                                            {"accept-language",
                                             {'Accept-Language',
                                              "en-gb,en;q=0.5"},
                                             {"accept-encoding",
                                              {'Accept-Encoding',
                                               "gzip,deflate"},
                                              {"accept-charset",
                                               {'Accept-Charset',

"ISO-8859-1,utf-8;q=0.7,*;q=0.7"},
                                               nil,nil},
                                              nil},
                                             {"connection",
                                              {'Connection',"keep-alive"},
                                              {"cache-control",

{'Cache-Control',"max-age=0"},
                                               nil,nil},
                                              nil}}},
                                           {"user-agent",
                                            {'User-Agent',
                                             "Mozilla/5.0 (Windows; U;
Windows NT 6.0; en-GB; rv:1.9) Gecko/2008052906 Firefox/3.0"},
                                            {"keep-alive",
                                             {'Keep-Alive',"300"},
                                             nil,nil},
                                            nil}}}}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080629/7318df1d/attachment.htm>


More information about the erlang-questions mailing list