Re: [Python-ideas] [Python-Dev] matrix operations on dict :)

On Wed, Feb 8, 2012 at 9:54 AM, julien tayon <julien@tayon.net> wrote:
{ "a" : 1 } + { "a" : { "b" : 1 } } == KABOOM. This a counter example that you can find out about at pangaia.sf.net "grouping model"). Admittedly, this might be arbitrary, but once decided you get the full power of the recursive data structure. It's kind of like defining the base case of factorial. The math (in my world) simply decided that factorial(0)=1 as the convention of "an empty product" (Wikipedia::Factorial). But, in theory, it should work and provide considerable power. Since it's all arbitrary one shouldn't get hung up too much on which convention is adopted, even though it will have to be followed thereafter. But "practice beats purity", as they say... :) mark

I wrote:
Oh, I should give my suggestion: That when a "non-named" atomic constant is added to a grouping (i.e. dict), a special key called "anon" (or perhaps the bulit-in None as the special key would actually work without ambiguity to other parts of python) is created with that holds the constant. Cheers! mark

Mark Janssen writes:
The math (in my world) simply decided that factorial(0)=1 as the convention of "an empty product" (Wikipedia::Factorial).
In modern math (ie, post-Eilenberg-Mac Lane), it's not really a convention (unlike, say, Euclid's Parallel Postulate); it's the only way to go if you want the idea of product to generalize. If you don't understand that, I have serious doubts that you know what you're talking about. If you do understand that, please take care to be more precise.

I wrote:
Oh, I should give my suggestion: That when a "non-named" atomic constant is added to a grouping (i.e. dict), a special key called "anon" (or perhaps the bulit-in None as the special key would actually work without ambiguity to other parts of python) is created with that holds the constant. Cheers! mark

Mark Janssen writes:
The math (in my world) simply decided that factorial(0)=1 as the convention of "an empty product" (Wikipedia::Factorial).
In modern math (ie, post-Eilenberg-Mac Lane), it's not really a convention (unlike, say, Euclid's Parallel Postulate); it's the only way to go if you want the idea of product to generalize. If you don't understand that, I have serious doubts that you know what you're talking about. If you do understand that, please take care to be more precise.
participants (2)
-
Mark Janssen
-
Stephen J. Turnbull