Slang::AltTernary

Alternative Ternary Experssion

NAME

Slang::AltTernary - an alternative (additional) Perl6 ternary statement.

SYNOPSIS

use Slang::AltTernary;

^10.pick < 5 ?āˆ
    Yes say "Heads"
    No  say "Tails";

DESCRIPTION

Slang::AltTernary is a toy for learning about modifying perl6 parsing with slangs.

It adds a new infix operator, ?āˆ, (that's a '?' followed by U+2048) which functions in much the same way as perl6's ternary operator 'infix::<?? !!>'.

The difference is instead of seperating the truthful branch from the falsey branch with '!!', AltTernary preceedes the truthful branch with 'Yes' and the falsey branch with 'No'.

It's not intended that this module be used for anything other than exploring the use of slangs - use in any real code is discouraged. You've been warned.

AUTHOR

Martin Ryan [email protected]

COPYRIGHT AND LICENSE

Copyright 2018 Martin Ryan

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.