Hi,

> [...]
> .method( Hash, arg1, ..., argN, ContextFunction )
> [...]

That all was not my point. My point was that it is irritating that the same 
function may be destructive or not just by providing the context-function. 
I'd vote for either never be destructive, or always. Since for functions like 
filter() it is difficult to go the "never destructive"-way, I'd like it to be 
always destructive and have an alternative version which is never 
destructive.

> So, with .filter("foo",function) I'm taking the opportunity to remove
> the need for:
> .filter("foo").each(function(){
>
> }).end()

That is exactly what the suggestet the filterend()-function is for. That way 
filter() ist always destructive and filterend() never. In both cases with or 
without a context function.

$('div').filter('.test') // return value only contains divs with class 'test'
$('div').filter('.test,  // return value only contains divs with class 'test'
        function() {
                ...
        });
$('div').filterend('.test') // return value contains all divs (useless)
$('div').filterend('.test,  // return value contains all divs
        function() {
                ...
        });

The last to calls have the same effect as

$('div').filter('.test').end()
$('div').filter('.test').each( function() {
        ...
}).end();

In all cases the context function is evaluated for each div with the 
class 'test'. The difference between filter() and filterend() is just the 
return value.

Christof

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to