2012/1/10 Ian Wootten <[email protected]>: > Hi all, Hi Ian!
> Now I've finally been able to compile liquidsoap, I'm having a hard > time getting anything at all to run. > > The following code is supposed to be a simple script that spits out > track details on changes. > > http://pastebin.com/vW1uWg3C > > Currently it just returns: > > At line 19, char 17: > this value has type > source(_) (infered at line 17, char 20-70) > but it should be a subtype of > (_)->_ > > Reading the docs doesn't really help much - I'm unsure what a subtype > of "(_)->_" is. Anything written with an arrow (->) denotes a function. For instance: (int) -> string for a function that takes an integer and returns a string. In order to try to make these messages less confusing, we sometimes do not display the arguments of the function when they are not relevant, and likewise for the return type. This, here: (_)->_ Just means "a function" :-) So, reading your error message again, it says: "Hey, I was expecting a source but I got a function." Finally, if we look at on_metadata's type, we get: toots@zulu scripts % liquidsoap -h on_metadata (...) Type: (?id:string, (([(string*string)])->unit), source('a))->source('a) Which tells us that when invoking on_metadata, the callback must be passed before the source. Reading your script, you get: on_metadata(live, track_call) And you can see that the source "live" is passed before the callback, which is why you get that error message! Romain > Anyone able to shed any light? > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > Savonet-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/savonet-users ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
