Nullable / Notnull:语法提议 [英] Nullable/Notnull : syntax proposal

查看:109
本文介绍了Nullable / Notnull:语法提议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我建议为C创建两个新关键字,''notnull''和

''nullable''。

他们的意思是按合同设计,确保在编译时验证一些规则



。它不应该需要额外的运行时间 -

支票

要实现。

我已经在这个URL上发布了它应该如何工作的描述:
http://sarnold.free.fr/wordpress/? p = 71

请阅读并告诉我你的想法。


问候,
$ b $bStéphane A.

Hello,

I am proposing to create two new keywords for C, ''notnull'' and
''nullable''.
Their meaning is a sort of ''design by contract'', ensuring some rules
are
verified at compile-time. It should not require additional runtime-
checks
to be implemented.
I have posted my description of how it should work at this URL:
http://sarnold.free.fr/wordpress/?p=71
Please read it and tell me what you think of it.

Regards,
Stéphane A.

推荐答案

sa *** **@free.fr 写道:

>

你好,


我建议为C创建两个新关键字,''notnull''和

''nullable''。

他们的意思是某种''设计按合同'',确保在编译时验证一些规则



。它不应该需要额外的运行时间 -

支票

要实现。

我已经在这个URL上发布了它应该如何工作的描述:
http://sarnold.free.fr/wordpress/? p = 71

请阅读并告诉我你的想法。
>
Hello,

I am proposing to create two new keywords for C, ''notnull'' and
''nullable''.
Their meaning is a sort of ''design by contract'', ensuring some rules
are
verified at compile-time. It should not require additional runtime-
checks
to be implemented.
I have posted my description of how it should work at this URL:
http://sarnold.free.fr/wordpress/?p=71
Please read it and tell me what you think of it.



我不需要它。

我不想要它。

我不喜欢不喜欢它。

我很惊讶它还没有在C99。


-

pete

I don''t need it.
I don''t want it.
I don''t like it.
I''m surprised it isn''t already in C99.

--
pete


sa*****@free.fr 写道:
sa*****@free.fr writes:

您好,


我建议为C创建两个新关键字,''notnull''和

''nullable''。

他们的意思是按合同设计,确保一些规则



在编译时验证。它不应该需要额外的运行时间 -

支票

要实现。

我已经在这个URL上发布了它应该如何工作的描述:
http://sarnold.free.fr/wordpress/? p = 71

请阅读并告诉我你的想法。


问候,

St ?? phane A.
Hello,

I am proposing to create two new keywords for C, ''notnull'' and
''nullable''.
Their meaning is a sort of ''design by contract'', ensuring some rules
are
verified at compile-time. It should not require additional runtime-
checks
to be implemented.
I have posted my description of how it should work at this URL:
http://sarnold.free.fr/wordpress/?p=71
Please read it and tell me what you think of it.

Regards,
St??phane A.



简化它。不需要可空的可空。因为它已经存在了。


另外我认为这是一个愚蠢的想法。只需将malloc包装成你想做的事情,而不是将命令转换为notnull变量。更多

效率。否则每次你分配到一个notnull系统将会执行这些检查。

Simplify it. There is no need for "nullable" since it''s already there.

In addition I think it''s a silly idea. Just wrap malloc to do what you want to
do rather than have the assignment to a notnull variable. Much more
efficient. Otherwise every time you assign to a notnull the system will
be performing these checks.


sa ***** @ free.fr 写道:

您好,


我建议为C创建两个新关键字,''notnull''和

''nullable''。

他们的意思是一种按合同设计,确保在编译时验证一些规则



。它不应该需要额外的运行时间 -

支票

要实现。

我已经在这个URL上发布了它应该如何工作的描述:
http://sarnold.free.fr/wordpress/? p = 71

请阅读并告诉我你的想法。


问候,
$ b $bStéphane A.
Hello,

I am proposing to create two new keywords for C, ''notnull'' and
''nullable''.
Their meaning is a sort of ''design by contract'', ensuring some rules
are
verified at compile-time. It should not require additional runtime-
checks
to be implemented.
I have posted my description of how it should work at this URL:
http://sarnold.free.fr/wordpress/?p=71
Please read it and tell me what you think of it.

Regards,
Stéphane A.



你可以通过

int函数来断言标准C中的参数不为空(int MyTable [静态1] ]);


这意味着参数MyTable至少有一个

元素,即它不能为NULL。


是的,它不是一个很好的语法,但它是标准的。


jacob

You can assert a parameter not being null in standard C by

int function(int MyTable[static 1]);

This means that the parameter MyTable has at least one
element, i.e. it can''t be NULL.

True, it is NOT a GREAT syntax but it is standard.

jacob


这篇关于Nullable / Notnull:语法提议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆