On 2018-08-05 23:48, Monte Goulding via use-livecode wrote:
On 6 Aug 2018, at 7:07 am, Mark Waddingham via use-livecode
<use-livecode@lists.runrev.com> wrote:
filter X by keeping the lines not matching pattern "regex"
My point was this statement can be written as both:
filter X by keeping the lines not matching pattern “regex"
and
filter X by discarding the lines matching pattern "regex"
So it would perhaps be a good idea to only allow `matching` rather
than `not matching`
To be fair - we could get rid of the inverted forms entirely. If you
want inclusion, use keep, if you want exclusion use discard. i.e.
filter X by keeping the lines with "..."
filter X by keeping the lines matching "..."
filter X by keeping the lines where "..."
filter X by discarding the lines with ".."
filter X by discarding the lines matching ".."
filter X by discarding the lines where ".."
This would probably work much more nicely actually (now I get what you
were saying!) - it means you don't have the 'double-negative' problem
(which I think is what you were referring to) - and 'where' gives you a
general 'get out' especially if we implement the 'matches' operator:
filter X by discarding the lines where each does not match "..."
So no expressivity is lost - but you retain the absolute clarity of
having keep/discard.
At the end of the day - why would you choose to use an extra token for a
negated form, when you can just change keeping to discarding - or vice
versa?
Hehe.. the `with expression` thing was me trying to come up with
something that worked with `with | without | matching | not matching`…
`where` is much better I agree.
Hehe - yeah - I think we've discussed it before (probably several times
over a long interval) so that at least require's no bike-shedding...
After all, in this case, if its good enough for SQL, I can't see why it
isn't good enough for us (it also happens to be entirely correct from an
English language point of view - which kinda helps, in an English-like
language).
Warmest Regards,
Mark.
--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode