> On 6 Aug 2018, at 12:38 am, Mark Waddingham via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
>  keeping where P -> P
>  keeping with P -> each matches wildcard P
>  keeping without P -> not (each matches wildcard P)
>  keeping matching P -> each matches pattern P
>  keeping not matching P -> not (each matches wildcard P)
> 
>  discarding where P -> not P
>  discarding with P -> not (each matches wildcard P)
>  discarding without P -> each matches wildcard P
>  discarding matching P -> not (each matches pattern P)
>  discarding not matching P -> each matches wildcard P
> 
> So the actual underling operation is the same: P is a boolean predicate 
> operating on 'each', where each is taken to be each 'chunk' of X in turn; if 
> P(each) returns true, the element is kept, otherwise it is discarded.
> 
> I quite like the above - it has a very simple underbelly (a single 
> operation!), but the actual English-like syntax is a true and correct 
> sentence.
> 
> What do people think?

I think it’s nice sugar but it adds complexity when trying to understand the 
statement. You need to comprehend the expression or pattern then comprehend the 
relationship between discarding/keeping and with | without | not matching | 
where in order to figure out what will actually happen. I would rather [by { 
keeping | discarding }] be a parser error if used with without and not matching.

Cheers

Monte
_______________________________________________
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