On 2012-01-03 23:08, Craig DeForest wrote:
> On Jan 3, 2012, at 2:48 PM, Chris Marshall wrote:
>> On Tue, Jan 3, 2012 at 4:08 PM, Craig DeForest 
>> <[email protected]> wrote:
>>> The threading engine needs to be thought about if full support is
>>> implemented for generic empty PDLs.  In particular, I believe
>>> empty dimensions should fail to match anything other than empty
>>> dimensions -- so, e.g., if $a is 2x0 and $b is 2x1, then "$a*$b"
>>> should throw an error, which it doesn't currently...
>>> 
>> 
>> Hmm, that seems to special case the empty piddle rather that 
>> following the standard rule that dims of size 1 match anything for
>> threading.  I don't know if that breaks something but having an
>> explicit error that is not required means that coding always has to
>> check for that case.
> 
> Well, maybe it *is* doing the right thing then.  I can't think of
> anything that is less surprising than generating a 2x0 output (though
> that is pretty surprising).
> 

Hmm... I can't seem to come up with a concrete use case right now, but I
think the implicit threading case could potentially happen, and would
tend to rank the "implicit threading" rule over the the "size matching"
rule, i.e. a 2x0 piddle is the right thing to return, odd though it is.
 My intuition is that size-0 dimensions should be annihilators for
structure-matching operations, where the implicit-threading rules for
size-1 dimensions causes these to act as identity elements.  There's no
contradiction if seen this way, since 1*0 = 0*1 = 0 fulfills both
criteria, so we would get something like a semiring with glue() as the
"+" operation and threading as "*".

Thanks to both of you for taking the time to dig into this issue, and
for your PDL maintainence work in general!

marmosets,
        Bryan

-- 
Bryan Jurish                           "There is *always* one more bug."
[email protected]         -Lubarsky's Law of Cybernetic Entomology


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to