Thanks for the reply. Will see what i can manage here.
Em 21 de outubro de 2011 04:56, David Baelde
<[email protected]>escreveu:
> Hi Fabio,
>
> Sorry for the delay, but I think I can help here. You can't change
> switch to reevaluate, but you just need to make sure all the
> computation is done inside the function passed as a switch predicate,
> so that it is performed again next time.
>
> When you write checkTime(11h06m), it corresponds to
> check_time(time_in_mod(...)), so it calls time_in_mod, gets a boolean,
> passes it to check_time, which returns either {true} or {false}, ie.
> tests that never change. (Recall that {true} is fun()->true.)
>
> Also, because you didn't use a ref for count, count>=2 would always be
> 0+1>=2.
>
> Let's rewrite this:
>
> def checkTime(interval) =
> count=ref(0)
> {
> count:=!count+1
> if !count>=2 then true else false end # or simply (!count >= 2)
> }
> end
>
> Right now it doesn't use the interval, but when you make use of it,
> access it using interval(), to tell liquidsoap that you don't expect a
> bool, but a function returning a bool. Accordingly, call
> checkTime({11h06m}) with the braces.
>
> Hope this helps,
> --
> David
>
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users