## the number of items

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, LCMark

[-hh]
VIP Livecode Opensource Backer
Posts: 1880
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

### Re: the number of items

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:28 pm, edited 1 time in total.
shiftLock happens

mwieder
VIP Livecode Opensource Backer
Posts: 2705
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

### Re: the number of items

Actually, even with infinities you do get exactly what you expect arithmetically, which is how Cantor's proof of the mapping of ordinal numbers to rational fractions works (although it took Cantor's brilliance to come up with it in the first place). Once you get into the axiom of choice things get a bit dicier, but if you accept the groundrules then the logic all falls into place.

dunbarx
VIP Livecode Opensource Backer
Posts: 5690
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

### Re: the number of items

My favorite way to explain how a seeming smaller infinity can be exactly the same size as a larger one, say showing that a one inch line contains the same number of points as a two inch line, is this old classic:

-

______________

_________________________________

Draw any straight line from the upper point through the shorter line down to the longer line. Every point in the short line has a twin in the longer. The trick is to stop "counting", which can drive you crazy, and start making one-to-one correspondences, which will give you enlightenment. Hermann will know that with a semi-circle in place of the short line above, with its center at that upper point, you can show that a finite line has as many points as an infinitely extended lower line.

This has gotten off topic, I see.

Craig

[-hh]
VIP Livecode Opensource Backer
Posts: 1880
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

### Re: the number of items

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:27 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
Posts: 5690
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

### Re: the number of items

Hermann.

This is just adorable. I did not know that constants resolved that way. Anyone else know that? I am starting another thread somewhere.

So comma - 2 = colon -16

Craig

[-hh]
VIP Livecode Opensource Backer
Posts: 1880
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

### Re: the number of items

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:27 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
Posts: 5690
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

### Re: the number of items

Hermann.

Shows you the subtle traps when translating from one system to another. The culprit is LC itself, since the snag happens when you add 0 to nothing. Instead of getting nothing, you get 0. This may even make sense, but it does show how that translation thing...

answer empty + 0 = 0 -- true

Craig

FourthWorld
VIP Livecode Opensource Backer
Posts: 6305
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

### Re: the number of items

dunbarx wrote:So comma - 2 = colon -16
I never knew that was possible. It seems inconsistent, though.

For example, using these constants works:

put comma - colon

...but this does not:

put comma - cr
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com

dunbarx
VIP Livecode Opensource Backer
Posts: 5690
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

### Re: the number of items

Richard.

See Hermann's post two above.

And just to ruin your lunch: answer plus + plus = 26

Craig

[-hh]
VIP Livecode Opensource Backer
Posts: 1880
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

### Re: the number of items

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:27 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
Posts: 5690
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

### Re: the number of items

Hermann.

It is not true that if you:

put empty into var, that there is one word, item or line in var. There are zero of any of those chunks.

I think the empty constant is sometimes more than it seems, and sometimes less. So although empty can hold a "place" for an item, as in:

"1,2,3,,," (which contains five items)

it does not mean that empty has any tangible existence AFTER the trailing comma. Looking at that string, it may be argued that the "thing" between the last comma and the quote is actually less than empty, and therefore does not constitute a trailing item, which would yield a total of six. I see, through my aging eyes, that last comma as an indicator, a prepended placeholder if you will, of a "potential", but nonetheless real sixth item. LC sees it as a trailing comma, er, period, with less than nothing, that is, less than empty itself, following. This is just a rationalization, true, but such is the stuff of a five page thread in this forum.

In other words, we have been all through the fact that "1,2,3" and "1,2,3," both contain three items. Er, period.

Craig

[-hh]
VIP Livecode Opensource Backer
Posts: 1880
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

### Re: the number of items

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:27 pm, edited 1 time in total.
shiftLock happens

mwieder
VIP Livecode Opensource Backer
Posts: 2705
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact: