tags:

views:

148

answers:

1

Hi, i have one yaws file(let say a.yaws) inside that I have a lot of function which i m using again and again .so i have decided to put those common function inside the other yaws file (let say common.yaws) and include this yaws to a.yaws. so what is the correct syntax for this. i m using it but seems not including the file -include("common.yaws").

thanx in adavance.

+3  A: 

If the functions you have in your common file are basically erlang functions you can simply put those functions in an erlang module and simply call the function directly. As an example:

(in one.yaws)

<erl>
   out(Arg) ->
    mycommonstuff:doIt(Arg).
</erl>

where mycommonstuff.erl contains the exported function doIt.

If your common.yaws file actually contains yaws type features you could use the server side include feature of yaws - that is explained here:

http://yaws.hyber.org/ssi.yaws

Alan Moore