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).roll($num) }; sub prefix:<â> ( Int $size ) { 1â$size } say â10; say 4â6; # Not working # â U+2146 Double-Struck Italic Small D #sub infix:<â > ( Int $num, Int $size ) { [+] (1..$size).roll($num) }; #sub prefix:<â > ( Int $size ) { 1â $size } #say â 10; #say 4â 6; On 10 August 2017 at 21:16, Simon Proctor <simon.proc...@gmail.com> wrote: > So I had a crazy little idea. I've played the odd bit of roleplaying in my > time and wanted to created a 'd' operator. > > Quite simple really. > > sub infix:<d> ( Int $num, Int $size ) { [+] (1..$size).roll($num) }; > > sub prefix:<d> ( Int $size ) { 1 d $size } > > Gives us 3 d 6 to roll 3 six sided dice or a prefix d 10 for a single 10 > sided dice. > > Except... I'd really like to write 3d6 or d10 but the parser barfs. > > Am I going to just have to live with that? Or did I miss something > obvious? > > Obviously it's possible to have operators that ignore whitespace (1+1 > works just fine) but is it possibly for user defined ones? > > Possibly more serious ones. > > Simon > -- Norman Gaywood, Computer Systems Officer School of Science and Technology University of New England Armidale NSW 2351, Australia ngayw...@une.edu.au http://turing.une.edu.au/~ngaywood Phone: +61 (0)2 6773 2412 Mobile: +61 (0)4 7862 0062 Please avoid sending me Word or Power Point attachments. See http://www.gnu.org/philosophy/no-word-attachments.html