Hi, I have just now pushed a small modification to allow type annotations for references and active sources. Here's an example of the syntax:
# r = ((ref []) : ref([active_source])) ;; r : ref([active_source(audio=?A,video=?B,midi=?C)]) = ref([]) Hope this helps and sorry for the delay, David On Sun, May 18, 2014 at 1:42 PM, okay_awright <[email protected]> wrote: > thanks david for the explanation, and I didn't even know that one could > force the type of a variable and bypass the automatic type inference > system: cool feature! > > On 18/05/2014 10:22, David Baelde wrote: >> Hi, >> >> We made strip_blank return an active source after some enhancement of >> type inference by Samuel... we knew it was still not perfect, but >> didn't expect that it would strike so soon. One solution for you woule >> be to annotate your list reference with its type, e.g. blah = ref (... >> : active_source) unfortunately active_source is not available in type >> annotations yet. So we have two choices: allow this type annotation >> (which is a good idea anyway) or revert strip_blank to return a normal >> source for now. I should be able to deal with this in a few days but >> not right now unfortunately -- Romain, Sam, don't hesitate to step in >> before that. >> >> Cheers, >> >> David >> >> On Sat, May 17, 2014 at 1:35 PM, okay_awright <[email protected]> wrote: >>> Hello everyone, >>> >>> With the recent versions of Liquidsoap, strip_blank() now outputs an >>> active_source. The same scripts used to work before, but now they don't. >>> >>> Here's the output when run: >>> At /usr/local/etc/liquidsoap/res/5shampoo_bridge.liq, line 64, char 36: >>> this value has type >>> ref([source(_)]) (inferred at >>> /usr/local/etc/liquidsoap/res/5shampoo_bridge.liq, line 43, char 36-41) >>> but it should be a subtype of (the type of the value at >>> /usr/local/etc/liquidsoap/res/3shampoo_core.liq, line 321, char 155) >>> ref([active_source(_)]) (inferred at >>> /usr/local/etc/liquidsoap/res/3shampoo_core.liq, line 195, char 65-97) >>> >>> line 64 of /usr/local/etc/liquidsoap/res/5shampoo_bridge.liq references >>> the item with the * before: >>> _source = ref mkoutput( >>> _seat_number, >>> _ws_key, >>> _p_key, >>> _channel_id, >>> _is_lv_shout, >>> _lv_port, >>> _lv_mntpnt, >>> _ref_independent_sources, >>> *_ref_independent_active_sources, >>> shutdown_output, >>> _last_user, >>> _last_key) >>> >>> line 43 of /usr/local/etc/liquidsoap/res/5shampoo_bridge.liq is: >>> _ref_independent_active_sources = ref [] >>> >>> line 321 of /usr/local/etc/liquidsoap/res/3shampoo_core.liq is this, >>> where char character 155 is represented by a *: >>> def mkoutput(_seat_number, _ws_key, _p_key, _channel_id, >>> _is_lv_shoutcast, _lv_port, _lv_mntpnt, _ref_independent_sources, >>> *_ref_independent_active_sources, _shutdown, _last_user, _last_key) = >>> >>> line 195 of /usr/local/etc/liquidsoap/res/3shampoo_core.liq represents >>> the line with the * before: >>> ref_source = ref strip_blank(max_blank=10., !ref_source, >>> threshold=-30.) >>> *_ref_independent_active_sources := list.append([!ref_source], >>> !_ref_independent_active_sources) >>> >>> I don't understand why that _ref_independent_active_sources list cannot >>> be automatically inferred as a list of active_source >>> If I modify: >>> ref_source = ref strip_blank(max_blank=10., !ref_source, >>> threshold=-30.) >>> and use another operator than strip_blank (which outputs a standard >>> source) then everything works as expected >>> >>> _ref_independent_active_sources is not fed with regular sources >>> anywhere; line 195 of /usr/local/etc/liquidsoap/res/3shampoo_core.liq is >>> the only place in all scripts where that list is supplied with data >>> >>> Thanks for your help >>> >>> -- >>> regards, >>> okay_awright >>> <okay_awright AT ddcr DOT biz> >>> >>> ------------------------------------------------------------------------------ >>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE >>> Instantly run your Selenium tests across 300+ browser/OS combos. >>> Get unparalleled scalability from the best Selenium testing platform >>> available >>> Simple to use. Nothing to install. Get started now for free." >>> http://p.sf.net/sfu/SauceLabs >>> _______________________________________________ >>> Savonet-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/savonet-users >> >> >> > > > -- > regards, > okay_awright > <okay_awright AT ddcr DOT biz> > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. > Get unparalleled scalability from the best Selenium testing platform available > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Savonet-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/savonet-users -- David ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
