Hi again !
>> presentation. At first:
>> out = output.icecast()
>> will be of type format -> source -> source, i.e. its a partial
>> application which needs at least a format and a source.
> Is it right to say, output.icecast() take a format and a source as
> args, "returning" a new source ?
> So what about the type (format, source) => source
> I have big problems reading types... it looks very complicated to me.
> I understand there is no "this function returns something" concept,
> but something more like "this function gives the populated/modified
> source"
>
>> Then you do:
>> out = output.icecast(%mp3)
>> Now out is of type source -> source, i.e. you have applied one more
>> argument, thus the type has changed.
> Here I understand that out has now its format, so its new type says
> that it wait for what remains to work: the source, and will provide a
> new source.
> ?
>
>> But if you do:
>> out(%mp3)
>> Then the variable out is still of type format -> source -> source
>> because the above was not kept..
> can you define "not kept" (from ? why ?)
>
>> Thus, if later you want to do:
>> out(source)
>> Then this will only work if out is of type source -> source, i.e. in
>> the first case above..
> This is not really clear but I swear I am trying... My abstractive
> brain needs time so I am going to give it a break :)
> I still don't understand how I can update a source in a "if" iteration...
>
> I think that the better would be that you provide a working snippet,
> and I'll try to understand what's happening why it works.
>
> :(
I think I am on the trail, thanks to your examples above.
The following script:
out = output.icecast(
fallible=true,
start=true,
url="bordel"
)
# out function waits for format and source.
# ('wait' is the term that is employed in language documentation,
section "partial application")
out = out(%mp3)
# out function now waits for the source.
s = input.alsa(device="pulse")
out(host="host.net", port=8000, password="hackme", mount="stream.mp3",
description="test",s)
# out is complete.
> . A definition has only one
> value over the course of its life, it never changes.
Now, what about enclosing out = out(%mp3) in a conditionnal ?
If the variable only "lives" in it's context, how do I do that ?
Because If I understand right, if I do:
stream_format = "mp3"
if stream_format == "mp3" then
out = out(%mp3)
else
print("not mp3")
end
Bam ! out is just as before, nothing changed...
------------------------------------------------------------------------------
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