Craig DeForest writes: > Quoth Luke Palmer on Monday 31 January 2005 03:46 pm, > > C_{ijkl} = A_{ij} * B_{kl} > > > > You write either of: > > > > Â @C[$^i; $^j; $^k; $^l] = @A[$^i; $^j] * @B[$^k; $^l] Â > > @C = Â @A[$^i; $^j] * @B[$^k; $^l] Â > > Hmm... This is both insanely great and also greatly insane. > > The issue is that, although the tensor notation is powerful, the readability > is becoming lost in all the sigils/funny_characters on the thread variables. > > Most of the non-perl-geek scientific-computing people I know already balk at > the '$' and '@' characters because they increase the amount of black noise in > scientific code too much; constructions like that just might send them all > screaming back to FORTRAN. Is there a way to generalize that reduces the > amount of black noise so that the expression shines through? > > << @C[ ^i; ^j; ^k; ^l ] = @A[ ^i; ^j ] * @B[ ^k; ^l ] >> > > is much better from a readability standpoint since the j's and k's are > actually visible, but may be horrific from a parsing perspective.
Yeah, the sigils do get in the way for small placeholder variables like these. Â @C[ $i; $j; $k; $l ] = @A[ $i; $j ] * @B[ $k; $l ] Â Losing the carets doesn't do much for us (and would force us to use the explicit syntax, whatever that might be). Hmm, on the other hand, ^ doesn't mean anything in term context yet. I feel uncomfortable about allowing ^ as a shorthand for $^, since every other variable in the whole damn language has one of the four standard sigils. Luke