On Wed, May 27, 2009 at 07:56:42PM +0200, Daniel Carrera wrote: > Here is another idea: Is it possible to declare a circumfix function > that calculates the magnitude of a vector? > > $magnitude = |@vector|; > > You know how in math, two vertical bars are a standard notation for > magnitude. Oh oh oh... is it possible to define a circumfix function for > the dot product? Something like: > > $dot_product = <@vector1,@vector2>; > > Is that possible? That would be uber-cool.
The problem with that is the presence of an existing prefix:<|> operator. One could fake it with a postfix:<|> macro that rewrites the AST produces by the prefix, except no one implements macros yet. But circumfix openers have to share longest-token space with prefixes. You could maybe use broken bar instead, circumfix:<¦ ¦>. Larry