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

Coercion convention universal or not? #4391

Closed
doomvox opened this issue Oct 22, 2023 · 4 comments
Closed

Coercion convention universal or not? #4391

doomvox opened this issue Oct 22, 2023 · 4 comments
Assignees

Comments

@doomvox
Copy link
Contributor

doomvox commented Oct 22, 2023

(1) I don't understand quite what's being said here. Is the convention universally enforced? Is it only mandatory under certain circumstances?

(2) Is this section up-to-date? The general thrust is you need to monkey patch existing classes to add coercion methods for new types. Is that still true?

https://new-raku.finanalyst.org/language/signatures#Coercion_type

"Turning one type into another is done with coercion methods that have the same name as the target type. This convention is made mandatory by Signatures."

@coke
Copy link
Collaborator

coke commented May 14, 2024

Note: the official link to those docs is https://docs.raku.org/language/signatures#Coercion_type

@coke
Copy link
Collaborator

coke commented May 15, 2024

"Turning one type into another is done with coercion methods that have the same name as the target type. This convention is made mandatory by Signatures."

I can't find this text in the doc source or history.

@raiph
Copy link
Contributor

raiph commented May 17, 2024

@coke coke closed this as completed in fde0a2b May 22, 2024
@coke
Copy link
Collaborator

coke commented May 22, 2024

Thanks for the report, added a note to the docs.

@coke coke added this to the 2024-Quarter-2 milestone May 22, 2024
@coke coke self-assigned this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants