I didn't attempt to cater for your test ii because it was not part of the original specs. tadman said.
As a note, the 'new' value is always present, even if it is undef.
If I remove all whitespace and newlines, redundant ;'s etc from my solution above it comes out to 87
sub f{local($^W,$a)=(0,pop);grep{!exists$a->{$_}{O}or$a->{$_}{O}ne$a-> +{$_}{C}}keys%$a} #87
Then I noticed that I could save a couple more whilst still retaining a 'safe' function (ie. doesn't stomp on any globals) by switch to mying $a for 85
sub g{local$^W=0;my$a=pop;grep{!exists$a->{$_}{O}or$a->{$_}{O}ne$a->{$ +_}{C}}keys%$a} #85
but I go the whole hog and abandon safety completely, this can be reduced further (and neatly, below the traditional 80 char line) to 78....
sub h{$^W=0;$a=pop;grep{!exists$a->{$_}{O}or$a->{$_}{O}ne$a->{$_}{C}}k +eys%$a} #78
In reply to Re: Re: (Golf) Warningless Comparison
by BrowserUk
in thread (Golf) Warningless Comparison
by tadman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |