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

NativeCall void function returns Mu type object #4528

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Conversation

0rir
Copy link
Contributor

@0rir 0rir commented Oct 24, 2024

Doc' that NativeCall's returns trait's default is Mu:U.

Emphasize void-is-only-for-pointers with its own paragraph.

Ref #5293

Doc' NativeCall's default `returns` trait as `Mu:U`.

Emphasize `void`-is-only-for-pointers with its own paragraph.
@raiph

This comment was marked as outdated.

@0rir
Copy link
Contributor Author

0rir commented Oct 25, 2024

@raiph, thank you. My phrasing was meant to convey what the return value is, not the constraints it must meet.

NativeCall chokes on the Mu:D and Mu:U type-ishes. But by the definition of definedness the return is :U.

Should this be on the language/nativetypes page also or instead?

Should this be tagged as an Rakudo-ism?

@raiph

This comment was marked as outdated.

@0rir
Copy link
Contributor Author

0rir commented Oct 27, 2024

There is a good case for the doc being more rigorous in its usage of defined versus DEFINITE; I am not sure that would be a net positive.

It is a flaw in the implementation or design that an is native sub's sig cannot bear a -->Mu:U which is why it is not in the PR.

Smileys are a fine refinement in @TimToady's design.

use NativeCall;
sub perror( Str $s) is native { … }
sub raku( Str $s -->Mu:U) { perror( $s) }
raku 'farewell';    # farewell: Success

@raiph

This comment was marked as outdated.

@0rir
Copy link
Contributor Author

0rir commented Oct 31, 2024

@raiph, be relieved for I am not pained by our discussion. It is just a matter of disagreeing.
It is usual that I am not as quick to reply as most here; this time I regret my delay for the extention of you unease.

I agree with the info in your "shot". Depending on your target audience, I see varied improvements possible. If you are interested, let me know.

@dontlaugh dontlaugh merged commit 1719ad2 into Raku:main Nov 12, 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

Successfully merging this pull request may close these issues.

3 participants