Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add practical examples of using Allomorphs, e.g., changing a Str Allomorph to an Int. #4483

Closed
tbrowder opened this issue Jun 6, 2024 · 0 comments
Labels
docs Documentation issue (primary issue type)

Comments

@tbrowder
Copy link
Member

tbrowder commented Jun 6, 2024

Problem or new feature

The docs go into great detail about the Allomorphs and how to create them from a literal number. However, how to change an Allomorph-like variable from one of its forms to the other is not shown.

Suggestions

In the Numerics section, add examples like this:

# Create a string that could be an Allomorph (but isn't)
my $a = "010";
say $a.^name;               # OUTPUT: Str (note: not Allomorph)
# Change to an Int representation:
$a .= Numeric;
say $a;                            # OUTPUT: 10
say $a.^name;               # OUTPUT: Int (note: not Allomorph)
@tbrowder tbrowder added the docs Documentation issue (primary issue type) label Jun 6, 2024
@coke coke added this to the 2024-Quarter-2 milestone Jun 6, 2024
@coke coke closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

2 participants