Re: User defined infix operators and whitespace

2017-08-26 Thread Norman Gaywood
It seems to work without spaces if you choose a symbol that is not letter-like. # đŸŽČU+1F3B2 Game Die sub infix:<đŸŽČ> ( Int $num, Int $size ) { [+] (1..$size).roll($num) }; sub prefix:<đŸŽČ> ( Int $size ) { 1đŸŽČ$size } say đŸŽČ10; say 4đŸŽČ6; # ⛏ U+26CF Pick sub infix:<⛏> ( Int $num, Int $size ) { [+] (1..$size

Re: User defined infix operators and whitespace

2017-08-10 Thread Brock Wilcox
I think there are a couple answers. The simple one is yes -- embrace the whitespace. Maybe wrap them in ()', like (2 d 6). Another line of ideas is wrapping things with some other operators. Maybe a special quoting operator or a converter. [[2d6]] # double for dice! "2d6":dice # postfix. This