Luis Alberto Zarrabeitia Gomez
kyrie at uh.cu
Wed Jun 17 18:03:08 EDT 2009
Quoting Lie Ryan <lie.1296 at gmail.com>:
> pdpi wrote:
> > On Jun 17, 5:37 pm, Lie Ryan <lie.1... at gmail.com> wrote:
> >> Steven D'Aprano wrote:
> >>> On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote:
> >>>> I was staring at a logic table the other day, and I asked myself, "what
> >>>> if one wanted to play with exotic logics; how might one do it?"
> >>> This might be useful for you, and if not useful, at least it might blow
> >>> your mind like it did mine.
> >>> (This is not original to me -- I didn't create it. However, I can't find
> >>> the original source.)
> >>> Imagine for a moment that there are no boolean values.
> >>> There are no numbers. They were never invented.
> >>> There are no classes.
> >>> There are no objects.
> >>> There are only functions.
> >>> Could you define functions that act like boolean values? And could you
> >>> define other functions to operate on them?
> >>> [basic lambda calculus definitions]
> What I meant was: if you can pass a function as an argument to another
> function, that means either: 1) you must use function pointer (numbers)
> or 2) function is a first-class object. Both violates the restriction
> (no number and no object respectively).
> Even after abandoning the semantics of functions in python, going to
> function as in purely mathematical sense, I still am not convinced
> (warning: I don't know lambda calculus, although I program in heavily
> functional style).
You are confusing semantics with implementation. At some point, of course one
would need to use real object (at the lowest level, the computer I'm typing this
in is a physical object). But the interesting part is that you can define the
whole logic system using nothing but functions. You may need to implement it
using objects, or maybe you could devise a machine that will behave like that
using only sticks on the floor, but that doesn't matter. From the user's
perspective, there would be only functions: no strings, no objects, no numbers.
That reminds me of my last class (disclaimer: I teach discrete math). I told my
students "well, let's assume that numbers exist", and I wasn't making fun of
them... I found that topic easier to understand (computability, primitive
recursion) if one ignores the numbers, even if one obviously has to write them
somewhere at some point.
Facultad de Matemática y Computación, UH
Participe en Universidad 2010, del 8 al 12 de febrero de 2010
La Habana, Cuba
More information about the Python-list