Contains vs is in
MikeKerner at roadrunner.com
Wed Jan 4 14:39:10 CET 2017
There is some subtlety that I am missing, Ali.
On Wed, Jan 4, 2017 at 5:22 AM, Ali Lloyd <ali.lloyd at livecode.com> wrote:
> Peter has pointed out that I am technically using the word 'subsequence' in
> error, and should probably have used 'substring' instead!
> (cf https://en.wikipedia.org/wiki/Subsequence vs
> On Wed, Jan 4, 2017 at 10:16 AM Ali Lloyd <ali.lloyd at livecode.com> wrote:
> > 'contains' and 'is in' are implemented exactly the same in LiveCode
> > Script, so there shouldn't be any difference. However there is an
> > interesting subtlety that emerges when you consider what these two bits
> > syntax should do, which explains why they are different in LCB.
> > When we say 'A contains B' where A is some sort of sequence (ordered
> > then I would argue we really mean that B is a subsequence of A. On the
> > other hand I think the interpretation of 'is in' is the same as that of
> > among the elements of'.
> > Thus 'contains' is actually a relation between sequences and sequences,
> > whereas 'is in' is one between elements and sequences. This makes no
> > difference in LCS for strings because the type of the sequence is the
> > as the type of the element, namely they are strings. However it does mean
> > that the following two should be considered anomalous:
> > 1) In LCS, 'is in' does not restrict the left hand side to a single char
> > 2) In LCS, no string other than empty 'contains' empty
> > Both of these anomalies are rectified in LCB. The situation becomes
> > clearer when using an LCB list, where <list> contains <string> is a
> > error, and <listA> is in <listB> is only true if listA occurs as an
> > *element* of listB, rather than a subsequence. Moreover <list> contains
> > is always true.
> > tl;dr - there should be no performance difference between 'contains' and
> > 'is in' in LCS.
> > On Tue, Jan 3, 2017 at 11:35 PM Bob Sneidar <bobsneidar at iotecdigital.com
> > wrote:
> > I interact with copier interfaces quite a lot and the process of backing
> > up the data involves going through various pages and typing what I see
> > there into a text file. I have always thought it would be great to write
> > app that can do it for me, but I have never been able to scrape anything
> > more than the HTML text displayed on the page.
> > already knowing what the values are though, I'm afraid I might meet with
> > unsurpassable difficluty.
> > Bob S
> > On Jan 3, 2017, at 15:02 , Mike Kerner <MikeKerner at roadrunner.com<
> > MikeKerner at roadrunner.com>> wrote:
> > the short answer is "yes", but it can be more complicated as it may
> > the site you are scraping. You can also (possibly) use a service that
> > yank that for you.
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
and did a little diving.
And God said, "This is good."
More information about the use-livecode