-
Notifications
You must be signed in to change notification settings - Fork 1k
Champion "Span<T>, aka interior pointer, aka stackonly struct" (C# 7.2) #666
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
Comments
A draft of more precise span safety rules is at https://gist.github.com/gafter/20aee8cfac801caebd19b49af180f708 |
The proposal link is broken. |
@gulshan The correct link is https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.2/span-safety.md The proposal was moved to the csharp-7.2 folder |
Fixed link. Thanks @initram |
Are using System;
[assembly:CLSCompliant(true)]
namespace MyLibrary
{
[CLSCompliant(true)]
[Obsolete("Types with embedded references are not supported in this version of your compiler.", false)]
public ref struct StackOnlyType
{
}
} |
Not sure if this topic is active and any C# designer pays attention to this but I have asked about the reason why And I even liked |
Because it was pretty simple and we didn't think it warranted any other syntax. No one felt particularly stronly, so we went with this. |
But, do you think it represents the meaning of |
While This is going to be even more true if we end up taking proposals like allowing fields to have a Basically this feature is all about ref-ness hence BTW: if you want to blame a person for |
Thanks @jaredpar for taking time to reply. When I read that document you shared, I see that |
In the same way that the term
Yes...? :)
I'm not certain how it's limited. Could you give an example? There are already many avenues being explored to enhance ref-structs in the future. Are there avenues that you think should be explored, but can't be because of the choice of this token? |
Disagree. I'm not sure how the choice of It's a word, it doesn't change the semantics. |
While I was typing my answer to @CyrusNajmabadi (which I deleted later), I realized something which we didn't discuss and that is Now you are combining the stack only characteristic that come from the nature of variables and parameters into |
@tarikguney if you'd like to discuss this topic more, there are appropriate avenues (like gitter.im or discord). You're talking about something (the syntax choice here) that was already decided on years ago and which isn't going to change. It's unclear what hte benefit of the discussion is. You asked why it was done this way, and it was answered. Is there something else you need to know at this point? |
Umm. Not agree. |
No worries. I got my answer. I wish I was there at the time. Thanks for your time! |
It literally doesn't. :) Regardless of the token we chose (which could have been
|
Next time, I will call an apple "pear" when I am asked what my favorite fruit is. I am sure people will understand :)) Anyways, thanks for the responses. |
/cc @jaredpar @VSadov @jcouv
The text was updated successfully, but these errors were encountered: