wtf wrote: ↑Fri Nov 29, 2019 12:53 am
This shows an astonishing lack of understanding.
Are you abusing Cunningham's law again?
wtf wrote: ↑Fri Nov 29, 2019 12:53 am
Surely you know that Python is an interpreted language. That means that when Python encounters a string like 0000 the parser operates in a manner exactly as defined by the programmers of the Python interpreter.
I think you are confusing the various features of the Type system (static/dynamic typing, strong/weak typing) with Python being an interpreted language. It has nothing to do with any of what you are trying to argue.
Strings are not Integers. Neither in Python (interpreted language) nor in C++ (compiled language).
https://repl.it/repls/WonderfulUsableDictionaries
Code: Select all
#include <iostream>
int main() {
/* This compares two integers - returns 1*/
std::cout << ( 0000 == 0 ) << std::endl;
/* This compares an integer to a string - returns 0 */
std::cout << ( '0000' == 0 ) << std::endl;
}
wtf wrote: ↑Fri Nov 29, 2019 12:53 am
In this case the string 0000 is interpreted as the integer 0.
This is demonstrably false since programming languages actually treat Strings and Integers as distinct data types. The interpreter will never convert a string into an integer for you unless you explicitly tell it to. This is called
type conversion a.k.a casting.
When you work your way up to Algebraic data types you might actually understand your confusion.
https://repl.it/repls/RadiantMediocreComputergames
Code: Select all
# This is a string
a = '0000'
print(type(a)) # => <class 'str'>
# This is an integer
b = 0000
print(type(b)) # => <class 'int'>
# A String is not an Integer
print(a != b) # True
# Cast string to integer
print(int(a) == b) # => True
wtf wrote: ↑Fri Nov 29, 2019 12:53 am
This is simply an arbitrary choice on the part of the language designer, enforced by the implementers of the particular Python interpreter you used.
Do you know of any Programming languages which can't tell the difference between Strings and Integers? Obviously, you can't tell the difference in Mathematics.
wtf wrote: ↑Fri Nov 29, 2019 12:53 am
We could just as easily define a variant of Python, call it Mython, where everything is pretty much the same but strings of the form 0, 00, 000, 0000, ... are interpreted as standing for the integers 1, 2, 3, 4, etc., respectively.
You could do that, but you are still going to have to figure out how to tell the difference between the Integer 00 and the String 00. Because Strings and Integers are different TYPES of objects.
What's the difference you ask?
00 + 00 = 4 (addition)
'00' + '00' = '0000' (concatenation)
'00' != 00
You would know this if you actually started from
UNTYPED Lambda Calculus and worked your way up to Types.
wtf wrote: ↑Fri Nov 29, 2019 12:53 am
It's perfectly obvious and basic that there is nothing mathematically or ontologically fundamental about the way we choose to represent small positive integers.
Naturally. You are welcome to use Roman numerals for all I care. So long as you aren't dumb enough to invent a language which is unable to tell the difference between the integer 5 and the English letter V.
wtf wrote: ↑Fri Nov 29, 2019 12:53 am
The fact that this is not immediately obvious to you speaks volumes about your ignorance and your obsessive belief that your modest programming skills, akin to being a grease monkey an oil change shop, somehow give you insight into mathematics and philosophy.
The fact that you think it's not obvious to me speaks volumes indeed.
What I have insights into is the entire field of Computation and Programming Language Theory. From that vantage point your precious Mathematics is just one of the very many paradigms of Computation - it's
symbolic computation.
There are many other paradigms of computation none of which have anything to do with Mathematics. The full list (for your education) is here:
https://en.wikipedia.org/wiki/Compariso ... _languages