[erlang-questions] calling func with predef params?
Gleb Peregud
gleber.p@REDACTED
Wed Jul 2 12:53:39 CEST 2008
These are not predefined parameters. It is pattern matching inside
function parameters definition. After expansion of #req{} by
preprocessor it is equal to (assuming that record req has 3 fields,
because i don't know exact number):
{req, _, _, _} = Req
Take a look at manual:
http://www.erlang.org/doc/programming_examples/records.html#1.7
2008/7/2 not norwegian swede <notnorwegian@REDACTED>:
> how do i call do_get?
>
> -module(test_iserve_app).
> -export([do_get/2]).
> -include("iserve.hrl").
>
> do_get(#req{} = Req, Args) ->
> {200, [], <<"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01
> Transitional//EN\">
> <html>
> <head>
> <title>Welcome to iserve</title>
> </head>
> <body>
> Hello
> </body>
> </html>">>}.
>
> ________________________________
> Sök efter kärleken!
> Hitta din tvillingsjäl på Yahoo! Dejting: http://se.meetic.yahoo.net
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
--
Gleb Peregud
http://gleber.pl/
Every minute is to be grasped.
Time waits for nobody.
-- Inscription on a Zen Gong
More information about the erlang-questions
mailing list