[erlang-questions] a little meta-programing help

anders conbere aconbere@REDACTED
Mon Oct 6 01:31:29 CEST 2008


On Sun, Oct 5, 2008 at 4:12 PM, Antoine Koener <antoine.koener@REDACTED> wrote:
> On Mon, Oct 6, 2008 at 12:15 AM, anders conbere <aconbere@REDACTED> wrote:
>> Today I sat down to try to make working with mochiweb a little cleaner
>> for myself. I wanted a way to specify a list of mappings between url
>> patterns and methods to be called with the matched variables from
>> them. I quickly ran into issues with not being able to create patterns
>> dynamically, and then tried using funs to wrap that functionality but
>> pretty soon I was back at the same mess I started with.
>>
>
> I used the list_to_atom fun to build the module name.
> This is not recommended but it's still really useful:
> check out: http://easyerl.blogspot.com/2008/07/my-mochiweb-webservice.html

Yeah, so I'm working more under the presumption that I can specify the
route to the module for each mapped url pattern. I'm not supper
interested in mapping urls to modules from the actual url text.

Thanks,
~ Anders

>
> --
>
> http://easyerl.blogspot.com/
> http://www.open-tools.org/
>



More information about the erlang-questions mailing list