-
Notifications
You must be signed in to change notification settings - Fork 102
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 neo C# specification #1157
base: master
Are you sure you want to change the base?
Add neo C# specification #1157
Conversation
docs/1-scope.md
Outdated
- The full C# language specification, as only a subset is used for Neo smart contracts; | ||
- The mechanism by which C# smart contracts are compiled and deployed to the Neo blockchain; | ||
- The mechanism by which C# smart contracts are invoked on the Neo blockchain; | ||
- The mechanism by which input data are processed by a C# smart contract on Neo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is processed
docs/1-scope.md
Outdated
@@ -0,0 +1,18 @@ | |||
# 1 Scope | |||
|
|||
This specification describes the form and establishes the interpretation of programs written in a subset of the C# programming language used for Neo smart contracts. It describes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It describes:
docs/1-scope.md
Outdated
- The semantic rules for interpreting Neo smart contract programs written in C#; | ||
- The restrictions and limits imposed by the Neo blockchain for C# smart contracts. | ||
|
||
This specification does not describe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:
docs/1-scope.md
Outdated
- The mechanism by which input data are processed by a C# smart contract on Neo; | ||
- The mechanism by which output data are processed after being produced by a C# smart contract on Neo; | ||
- The size or complexity limitations of a smart contract imposed by the Neo blockchain; | ||
- All minimal requirements of the Neo blockchain that is capable of supporting C# smart contracts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not understand this last sentence. Can you try to rephrase?
docs/10-conversions.md
Outdated
> int c = (int) b; // explicit conversion from long to int | ||
> ``` | ||
> | ||
> *end example* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/10-conversions.md
Outdated
> Color c0 = 0; | ||
> | ||
> // Other int expressions need explicit conversion | ||
> Color c1 = (Color)1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not understand this perfect, why just 0
automatically gets "Red" and 1 do not get "Blue"? Is that correct?
To get Blue
we need (Color)1
, yes?
docs/10-conversions.md
Outdated
> Func<int, int> square = x => x * x; | ||
> ``` | ||
> | ||
> *end example* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I think this end example in the end is wrong or a little bit strange.
Very good @Jim8y, I will try to read it with time and comment. Very good initiative. |
docs/10-conversions.md
Outdated
For the purposes of conversion, the types `object` and `dynamic` are identity convertible ([§10.2.2](10-conversions.md#1022-identity-conversion)). | ||
|
||
However, dynamic conversions ([§10.2.10](10-conversions.md#10210-implicit-dynamic-conversions) and [§10.3.8](10-conversions.md#1038-explicit-dynamic-conversions)) apply only to expressions of type `dynamic` ([§8.2.4](8-types.md#824-the-dynamic-type)). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good if you could mark the parts you actually write and the other ones from the original C# specification.
I imagined that, maybe, in this file, you wrote until here, and the remainder of this file would be be examples obtained from the original, without copy.
Can you clarify that?
I think that if you divide that (at least for now during revision), it will help a lot.
this is based on https://learn.microsoft.com/en-us/dotnet/csharp/specification/overview and adopted to neo C#, with all neo C# design details.