Hi Martin,

Using your terminology to clarify, you could write:

On Wed, Jun 15, 2011 at 10:37 AM, Martin Hamant <[email protected]> wrote:
> out = output.icecast(
>                        fallible=true,
>                        start=false
>                        )

out =
> if stream_format == "mp3" then
>        out(%mp3)
> end
# here you also need the else branch to say what out becomes if
stream_format != "mp3".
# then the rest is as before

Perhaps one way to clarify things is to avoid calling "outputs" a
"global variable" that is "initialized". A definition has only one
value over the course of its life, it never changes. You may hide it
in some part of the script with another definition, but this is really
different:
x = 1
if true then
   x = 2
   # here x is 2
   print(x)
end
# x is 1 again
print(x)
# in the if-then-block, you could as well replace all occurrences of "x" by "y"

Your "dyn_sources" is closer to what is usually called a (global)
variable. It has an initial value (dyn_source = ref <initial value>)
but its value can change over time (dyn_source := <new value>).

I know these differences can be confusing. I hope that my explanations
help you see the difference, which should be useful when writing
scripts.

Cheers,
-- 
David

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to