unforseen behavior

mog <>
Thu Apr 29 17:45:48 CEST 2010


Hello I was playing with some code to cache results of some ldap
queries and in doing so I am getting something odd attached is sample
code that shows my problem.  Is there a reason the vm wont call my
unexported module?


-- 
Matthew O'Gorman
xim: 
email: 
site: http://blog.rldn.net
+-----------------------------------------------------------------------+
  It is easier for a camel to pass through the eye of a needle if it is
  lightly greased.
                  -- Kehlog Albran, "The Profit"
+-----------------------------------------------------------------------+
-------------- next part --------------
-module(test).
-export([works/0, fails/0, exported_func/1]).

exported_func(Subtract) ->
    3 - Subtract.

random_func(Add) ->
    3 + Add.

works() ->
    abstract_works(exported_func, 3).

abstract_works(Func, Arg) ->
    io:format("Result is ~p~n", [test:Func(Arg)]).

fails() ->
    abstract_fails(random_func, 3).

abstract_fails(Func, Arg) ->
    io:format("Result is ~p~n", [Func(Arg)]).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20100429/0a299b13/attachment.bin>


More information about the erlang-questions mailing list