[erlang-questions] how to make the comprehension work

Garrett Smith g@REDACTED
Mon Aug 17 19:32:54 CEST 2015


On Mon, Aug 17, 2015 at 12:22 PM, Roelof Wobben <r.wobben@REDACTED> wrote:
> Op 17-8-2015 om 19:17 schreef Lukas Winkler:
>>
>> On 17 August 2015 at 19:14, Roelof Wobben <r.wobben@REDACTED> wrote:
>>>
>>> Hello,
>>>
>>> I try to extract the modules names from the output of code:loaded_all.
>>>
>>> So I tried this :
>>>
>>> -module(module).
>>>
>>> -export([most_used_function_name/0]).
>>>
>>> most_used_function_name() ->
>>>     process_module_data(code:all_loaded()).
>>>
>>> process_module_data(Loaded_modules)  ->
>>>      Module_list = get_modules_name(Loaded_modules).
>>>
>>> get_modules_name(Loaded_Modules_list) ->
>>>      [ModuleList || [{ModuleList, _}] <- Loaded_Modules_List ].
>>
>>
>> Friendly reminder that we are not your compiler. Count the ]....
>>
>> -winlu
>>
>
> I know that. If I count the [ I see 2  and ] I see also 2.

He he - no, it's not that.

The problem is that you're not taking the error message at face value.

Unbound means it's unbound - so, it's not an argument and not
otherwise defined at that point in the function.

You can get this!



More information about the erlang-questions mailing list