On 2018-08-06 00:03, Mark Wieder via use-livecode wrote:
On 08/05/2018 02:48 PM, 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`

True, but syntacticly I like the idea of being able to place "not" in
front of any boolean without having to remember where it's legal and
where it's not. I also think it's harder on the engine (this off the
top of my head without looking at the code <g>) to specify where "not"
is legal.

In this case the forms would be hardcoded:

  'not matching pattern "regex"'

is actually (essentially) sugar for:

  'where not each matches "regex"'

So *if* we could implement it like that then it would potentially do no harm - *however* as it stands it would be implemented as hard-coded parsing / exec code - so its actually more work to support 'not' here, and not less.

However, there is certainly a consistency argument to be had - its whether consistency is always better than a slight amount of positive coercion - in terms of restricting some forms of syntax which actually reduce readability rather than increase it (which, I think, on balance 'not' here might well do - as in reduce - and since this whole discussion came about because *I* have a significant problem parsing the 'filter' command as it stands - readability is perhaps the main concern here).

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

Reply via email to