Steffen Schwigon wrote:
<snip>
Thanks for reporting the solution back.

And it even works with unicode operators. Looks like we finally
really get our "ankh, pentagram, and that smiley teddy bear from
that Grateful Dead album". (*) :-) Thanks to Unicode, thanks to Pugs
So hopefully in the same spirit :

sub infix:<☥> {...};
sub infix:<☆> {...};
sub infix:<☺> {...};

(3 ☥ 40 ☆ 7 ☺ 50).say;

sub infix:<☥> ($l,$r) {
<The > ~ $l ~ < wise men spent > ~ $r ~ < days >
};

sub infix:<☆> ($l,$r) {
$l ~ < following a star in the > ~ $r ~ <-th heaven >
};

sub infix:<☺> ($l,$r) {
$l ~ < to become very happy for > ~ $r ~ < days and nights>
};


Biggest problems are the following:
a) finding the symbols - I had to use two editors, and getting them to show them on screen b) mixing types. My version of pugs does not respect the white space at the start and end of strings. Also if the functions are given as <<text $l more text>>, all the white space is excluded. Not sure if this is a feature or a non-feature.

Richard

Reply via email to