key-hash-proc for Set-of - Printable Version +- Curl Global Community (https://communities.curl.com) +-- Forum: Discussions (https://communities.curl.com/forumdisplay.php?fid=1) +--- Forum: General Curl questions (https://communities.curl.com/forumdisplay.php?fid=2) +--- Thread: key-hash-proc for Set-of (/showthread.php?tid=564) |
key-hash-proc for Set-of - RobertShiplett - 07-16-2012 I have had no success setting key-hash-proc and key-equality-proc for a {Set-of } even when predefining as constants as per the docs for ChartDataSeriesSet Is there a known issue? The compiler reports that Applet already defines key-hash-proc or complans that the proc passed is not a compile-time constant. The docs contain no working example of a set of user-defined instances using declared hash and equal? as described in the {Set of } docs A reply would be much appreciated as I should be able to use {difference } and {intersection } to handle my sets efficiently. thanks in advance for any assistance ... Contrary to the Doc's QUOTE This Type is simply a convenient shorthand for: {Set-of ChartDataSeries, key-hash-proc = ChartDataSeries.hash, key-equality-proc = ChartDataSeries.equal? } THAT CODE GIVES ERROR Argument [proc ChartDataSeries.hash] to Set-of is not an immutable value It is in fact required to use a {define-proc } wrapper as a work-around, is it not ? RE: key-hash-proc for Set-of - wbardwell - 07-18-2012 It does look like class proc's do not work for parametrized class parameters, even though I would expect them to work. As you say, putting the code in a top level define-proc (not inside a define-class) will let that work, as would wrapping the call to the class proc in a local {proc}. RE: key-hash-proc for Set-of - RobertShiplett - 07-24-2012 Hi Is there any chance of fixing the '#' anchor behavior for Curl links ? At the moment it almost prevents Curl applets at height=100% in HTML as the navigation is crippled unless a link is left exposed in HTML. thanks Robert RE: key-hash-proc for Set-of - wbardwell - 07-28-2012 Another work around is to call the function before using it in the parameterized type expression, that seems to get it to be converted into a proper proc. |