Erlang/OTP Forums

Author Message

<  User Contributions  ~  lfun - evaluates non-exported functions

uwiger
Posted: Fri Jun 15, 2007 8:49 pm Reply with quote
User Joined: 03 Jul 2006 Posts: 567 Location: Sweden
This module allows for evaluation of local functions in any module as long as there is 'debug_info' present in the corresponding beam file.

For those times when you really want to test a local function from the shell, and cannot recompile the module.

Example:

Code:

Eshell V5.5.4.3  (abort with ^G)
1> lfun:eval(lists,sublist_2, [[1,2,3,4,5],2]).
[1,2]
2> erlang:function_exported(lists,sublist_2,2).
false
3> Abst = lfun:load_abstract(lists).
{lfun,
    lists,
    {dict,
     ...}}
4> lfun:eval(lists,sublist_2, [[1,2,3,4,5],2], Abst).
[1,2]
[/code]



lfun.erl
 Description:

Download
 Filename:  lfun.erl
 Filesize:  3.55 KB
 Downloaded:  802 Time(s)

View user's profile Send private message Visit poster's website

Display posts from previous:  

All times are GMT
Page 1 of 1
Post new topic

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum