the history of philosophy, a.c. grayling - 1 introduction, philosophy before plato
introduction for almost all of its history ‘philosophy’ had the general meaning of ‘rational enquiry’, though from the beginning of modern times in the renaissance until the nineteenth century it more particularly meant what we now call ‘science’ what we now call “philosophy” was marked by labels such as “metaphysics” and “moral philosophy” to distinguish it from what we now call “science”. the word “scientist” was coined in 1833, since which the words “philosophy” and “science” took on their current meanings ...
c++ template-like invocation in python
so the other day for whatever reason i really wanted to invoke python functions as if they were c++ template functions… like so: template <int x> int add(int y) { return x + y; } printf("%d\n", add<5>(3)); if we ignore semantics, add<5>(3) seems to be a valid python expression – roughly translating to add.__lt__(5).__gt__(3) i quickly whipped up a prototype: class TemplateAdd: def __init__(self): self.x = None def __lt__(self, x): self.x = x return self def __gt__(self, y): return self.x + y add = TemplateAdd() print(add<5>(3)) but somehow it prints True… thanks, chained comparisons. the expression add<5>(3) evaluates to add.__lt__(5) and 5 > 3, and with no way to overload the and operator, the dream is dead unless i come to terms with the deranged syntax of (add<5)>3 (doesnt <5)>3 kind of look like a fish?) ...