[erlang-questions] port program -- how to start it and use it?

Peter Smith <>
Sun Sep 14 20:30:55 CEST 2008


I'm looking at the Erlang Interoperability Tutorial, and using it for my own
little bit of interoperability -- and I Just Don't Get something:
I can see the 'start' and 'foo' and 'bar' and 'stop' functions, and I even
think I understand them.  What I want to do is make a "unit test" that does
a start, calls some 'foo' and checks the results, and then calls 'stop'.
 I've made a module that works with my own program (which was really quite
simple -- certainly five times easier than Perl), and from the shell I can
type in the commands 'start', 'foo', and 'stop' with no problem.

But I can't make a unit test!  When I try this:

g() ->
textstat:start(),
textstat:enum(ascii),
textstat:stop().

I just get an error as if from the 'enum' (my version of 'foo') that implies
that the start hasn't actually finished starting yet.  And in any event,
won't the return from 'g' really be the results of the 'stop' when I really
want it to be the result of the 'enum(ascii)'?

Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080914/e9df2b30/attachment.html>


More information about the erlang-questions mailing list