On Mon, Jul 1, 2013 at 11:30 AM, Tim <erlang@5869.us> wrote:
I get an error if I try to call it directly:

Dynamic compile error: /Users/tim/test.yaws:42:
function whatCat/0 undefined

That error persists even if _neither_ erl chunk has a "module=…" attribute.

So, specifically, this code:

<erl>
out(Arg) -> {html, "Cats"}.
whatCat() -> "Burmese".
</erl>

<erl>
out(Arg) -> {html, whatCat()}.
</erl>

generates this output:

Cats
Dynamic compile error: /Users/tim//cats.yaws:7:
 function whatCat/0 undefined
generated file at: /Users/tim/.yaws/yaws/default/m40.erl

You can export the whatCat/0 fun to other modules like this:

<erl module=identify>

-export([whatCat/0]).

out(Arg) ->
        {html, "Cats"}.
whatCat() ->
        "Burmese".
</erl>

<erl>
out(Arg) ->
        {html, identify:whatCat()}.
</erl>

Works for me.

--steve