契约式设计:修订间差异

求闻百科,共笔求闻
添加的内容 删除的内容
(机器人:替换{{reflist}}等模板参数、替换裸露的<references />)
(机器人:清理不当的来源;移除无用的模板参数;替换{{reflist}}等模板参数;替换裸露的<references />)
第74行: 第74行:
| url = http://dlang.org/contracts.html
| url = http://dlang.org/contracts.html
| access-date = 2014-11-10
| access-date = 2014-11-10
|
| archive-date = 2014-11-28
|
| archive-url = https://web.archive.org/web/20141128104628/http://dlang.org/contracts.html
}}</ref>
}}</ref>
* {{en-link|Dafny}}
* {{en-link|Dafny}}
第82行: 第82行:
* [[Kotlin]]
* [[Kotlin]]
* [[Mercury (编程语言)|Mercury]]
* [[Mercury (编程语言)|Mercury]]
* {{en-link|Oxygene (编程语言)|Oxygene (programming language)|Oxygene}}(曾叫做Chrome和Delphi Prism<ref>{{cite web | url=http://edn.embarcadero.com/article/39398 | title=Write Cleaner, Higher Quality Code with Class Contracts in Delphi Prism | publisher=Embarcadero Technologies | access-date=20 January 2016 | author=Hodges, Nick | archive-date=2021-04-26 | archive-url=https://web.archive.org/web/20210426163433/https://edn.embarcadero.com/article/39398 }}</ref>)
* {{en-link|Oxygene (编程语言)|Oxygene (programming language)|Oxygene}}(曾叫做Chrome和Delphi Prism<ref>{{cite web | url=http://edn.embarcadero.com/article/39398 | title=Write Cleaner, Higher Quality Code with Class Contracts in Delphi Prism | publisher=Embarcadero Technologies | access-date=20 January 2016 | author=Hodges, Nick | | }}</ref>)
* [[Racket]]<ref>Findler, Felleisen [http://www.eecs.northwestern.edu/~robby/pubs/papers/ho-contracts-icfp2002.pdf Contracts for Higher-Order Functions]</ref>
* [[Racket]]<ref>Findler, Felleisen [http://www.eecs.northwestern.edu/~robby/pubs/papers/ho-contracts-icfp2002.pdf Contracts for Higher-Order Functions]</ref>
* {{en-link|Sather}}
* {{en-link|Sather}}
第90行: 第90行:
| url = https://www.scala-lang.org/api/current/scala/Predef$.html
| url = https://www.scala-lang.org/api/current/scala/Predef$.html
| access-date = 2019-05-24
| access-date = 2019-05-24
|
| archive-date = 2019-12-25
|
| archive-url = https://web.archive.org/web/20191225101235/https://www.scala-lang.org/api/current/scala/Predef$.html
}}</ref><ref>[[Strong typing]] as another "contract enforcing" in Scala, see discussion at [https://www.scala-lang.org/old/node/6958 scala-lang.org/] .</ref>
}}</ref><ref>[[Strong typing]] as another "contract enforcing" in Scala, see discussion at [https://www.scala-lang.org/old/node/6958 scala-lang.org/] .</ref>
* [[SPARK]](经过[[Ada]]程序的[[静态程序分析|静态分析]])
* [[SPARK]](经过[[Ada]]程序的[[静态程序分析|静态分析]])
第110行: 第110行:
** [[C++设计新思维|Loki库]],提供叫做ContractChecker的机制用来验证一个类服从契约设计。
** [[C++设计新思维|Loki库]],提供叫做ContractChecker的机制用来验证一个类服从契约设计。
** DBC C++<ref>[https://github.com/Bambofy/dbc_cpp DBC C++] Design by contract for C++</ref>
** DBC C++<ref>[https://github.com/Bambofy/dbc_cpp DBC C++] Design by contract for C++</ref>
* [[C Sharp (programming language)|C#]](和其他.NET语言),通过Code Contracts<ref>{{cite web|url=https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/code-contracts|title=Code Contracts|website=msdn.microsoft.com|access-date=2022-03-02|archive-date=2022-06-04|archive-url=https://web.archive.org/web/20220604001131/https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/code-contracts}}</ref>
* [[C Sharp (programming language)|C#]](和其他.NET语言),通过Code Contracts<ref>{{cite web|url=https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/code-contracts|title=Code Contracts|website=msdn.microsoft.com|access-date=2022-03-02||}}</ref>
* [[Groovy]],通过GContracts。
* [[Groovy]],通过GContracts。
*[[Go]],通过dbc<ref>{{Cite web |url=https://github.com/drblez/dbc |title=dbc |access-date=2022-03-02 |archive-date=2022-06-04 |archive-url=https://web.archive.org/web/20220604225409/https://github.com/drblez/dbc }}</ref>或gocontracts<ref>{{Cite web |url=https://github.com/Parquery/gocontracts |title=gocontracts |access-date=2022-03-02 |archive-date=2022-06-03 |archive-url=https://web.archive.org/web/20220603182456/https://github.com/Parquery/gocontracts }}</ref>
*[[Go]],通过dbc<ref>{{Cite web |url=https://github.com/drblez/dbc |title=dbc |access-date=2022-03-02 ||}}</ref>或gocontracts<ref>{{Cite web |url=https://github.com/Parquery/gocontracts |title=gocontracts |access-date=2022-03-02 ||}}</ref>
* [[Java]]:
* [[Java]]:
** OVal<code>[https://sebthom.github.io/oval/ OVal]</code>,经由{{en-link|AspectJ}}。
** OVal<code>[https://sebthom.github.io/oval/ OVal]</code>,经由{{en-link|AspectJ}}。
** Contracts for Java<ref>{{Cite web |url=https://github.com/nhatminhle/cofoja |title=Contracts for Java |access-date=2022-03-02 |archive-date=2022-03-03 |archive-url=https://web.archive.org/web/20220303010141/https://github.com/nhatminhle/cofoja }}</ref>(Cofoja)
** Contracts for Java<ref>{{Cite web |url=https://github.com/nhatminhle/cofoja |title=Contracts for Java |access-date=2022-03-02 ||}}</ref>(Cofoja)
** {{en-link|Java建模语言|Java Modeling Language}}(JML)
** {{en-link|Java建模语言|Java Modeling Language}}(JML)
** {{en-link|Bean Validation}}(只有先决条件和后置条件)<ref>{{cite web|url=http://beanvalidation.org/1.1/spec/|title=Bean Validation specification|website=beanvalidation.org|access-date=2022-03-02|archive-date=2014-07-16|archive-url=https://web.archive.org/web/20140716023527/http://beanvalidation.org/1.1/spec/}}</ref>
** {{en-link|Bean Validation}}(只有先决条件和后置条件)<ref>{{cite web|url=http://beanvalidation.org/1.1/spec/|title=Bean Validation specification|website=beanvalidation.org|access-date=2022-03-02||}}</ref>
** [http://www.valid4j.org valid4j]
** [http://www.valid4j.org valid4j]
* [[JavaScript]],通过AspectJS(特别是AJS_Validator)、Cerny.js、ecmaDebug、jsContract、dbc-code-contracts<ref>{{Cite web |url=https://www.npmjs.com/package/dbc-code-contracts |title=dbc-code-contracts |access-date=2022-03-02 |archive-date=2021-11-04 |archive-url=https://web.archive.org/web/20211104135749/https://www.npmjs.com/package/dbc-code-contracts }}</ref>或jscategory。
* [[JavaScript]],通过AspectJS(特别是AJS_Validator)、Cerny.js、ecmaDebug、jsContract、dbc-code-contracts<ref>{{Cite web |url=https://www.npmjs.com/package/dbc-code-contracts |title=dbc-code-contracts |access-date=2022-03-02 ||}}</ref>或jscategory。
* [[Common Lisp]],通过宏设施或[[Common Lisp对象系统|CLOS]][[元对象协议]]。
* [[Common Lisp]],通过宏设施或[[Common Lisp对象系统|CLOS]][[元对象协议]]。
* [[Nemerle]],通过宏。
* [[Nemerle]],通过宏。
* [[Nim]],通过宏<ref>{{Cite web |url=https://github.com/Udiknedormin/NimContracts |title=macros |access-date=2022-03-02 |archive-date=2022-06-06 |archive-url=https://web.archive.org/web/20220606225116/https://github.com/Udiknedormin/NimContracts }}</ref>。
* [[Nim]],通过宏<ref>{{Cite web |url=https://github.com/Udiknedormin/NimContracts |title=macros |access-date=2022-03-02 ||}}</ref>。
* [[Perl]],通过[[CPAN]]模块Class::Contract(出自{{en-link|Damian Conway}})或Carp::Datum(出自Raphael Manfredi)。
* [[Perl]],通过[[CPAN]]模块Class::Contract(出自{{en-link|Damian Conway}})或Carp::Datum(出自Raphael Manfredi)。
* [[PHP]],通过PhpDeal<ref>{{Cite web |url=https://github.com/php-deal/framework |title=PhpDeal |access-date=2022-03-02 |archive-date=2022-06-04 |archive-url=https://web.archive.org/web/20220604235145/https://github.com/php-deal/framework }}</ref>、{{en-link|Praspel}}或Stuart Herbert的ContractLib。
* [[PHP]],通过PhpDeal<ref>{{Cite web |url=https://github.com/php-deal/framework |title=PhpDeal |access-date=2022-03-02 ||}}</ref>、{{en-link|Praspel}}或Stuart Herbert的ContractLib。
* [[Python]],使用包如deal<ref>{{Cite web |url=https://github.com/life4/deal |title=deal |access-date=2022-03-02 |archive-date=2022-06-13 |archive-url=https://web.archive.org/web/20220613160502/https://github.com/life4/deal }}</ref>、icontract、PyContracts、Decontractors、dpcontracts、zope.interface、PyDBC或Contracts for Python。
* [[Python]],使用包如deal<ref>{{Cite web |url=https://github.com/life4/deal |title=deal |access-date=2022-03-02 ||}}</ref>、icontract、PyContracts、Decontractors、dpcontracts、zope.interface、PyDBC或Contracts for Python。
* [[Ruby]],通过Brian McCallister的DesignByContract、Ruby DBC ruby-contract或contracts.ruby。
* [[Ruby]],通过Brian McCallister的DesignByContract、Ruby DBC ruby-contract或contracts.ruby。
* [[Rust]],通过contracts<ref>{{Cite web |url=https://crates.io/crates/contracts |title=contracts |access-date=2022-03-02 |archive-date=2022-05-31 |archive-url=https://web.archive.org/web/20220531065921/https://crates.io/crates/contracts }}</ref>crate。
* [[Rust]],通过contracts<ref>{{Cite web |url=https://crates.io/crates/contracts |title=contracts |access-date=2022-03-02 ||}}</ref>crate。
* [[Tcl]],通过{{en-link|XOTcl}}面向对象扩展。
* [[Tcl]],通过{{en-link|XOTcl}}面向对象扩展。
{{div col end}}
{{div col end}}