⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typesafe.tcl

📁 sqlite database for embed linux
💻 TCL
字号:
set rcsid {$Id: different.tcl,v 1.7 2006/05/11 13:33:15 drh Exp $}source common.tclheader {SQLite Is Typesafe}puts {<p>In December of 2006, <a href="http://en.wikipedia.org/">wikipedia</a> defines <a href="http://en.wikipedia.org/wiki/Type_safety">typesafe</a>to a property of programming languages that detects and prevents"type errors".The wikipedia says:</p><blockquote>The behaviors classified as type errors by any given programming languageare generally those that result from attempts to perform on some value(or values) an operation that is not appropriate to its type (or theirtypes). The fundamental basis for this classification is to a certain extent a matter of opinion: some language designers and programmers take the view that any operation not leading to program crashes, security flaws or other obvious failures is legitimate and need not be considered an error, while others consider any contravention of theprogrammer's intent (as communicated via typing annotations) to beerroneous and deserving of the label "unsafe".</blockquote><p>We, the developers of SQLite, take the first and more liberal view oftype safety expressed above - specifically that anything that doesnot result in a crash or security flaw or other obvious failures isnot a type error.Given this viewpoint, SQLite is easily shown to be typesafe since almost all operations are valid and well-defined for operands of all datatypes and those few cases where an operation is only validfor a subset of the available datatypes (example: inserting avalue into an INTEGER PRIMARY KEY column) type errors are detected andreported at run-time prior to performing the operation.</p><p>Some commentators hold that type safety implies static typing.SQLite uses dynamic typing and thus cannot be typesafe in the eyesof those who believe that only a statically typed language can betypesafe.  But we believe that static typing is a distinct propertyfrom type safety.  To quote again from the<a href="http://en.wikipedia.org/wiki/Type_safety">wikipedia</a>:</p><blockquote>[T]ype safety and dynamic typing are not mutually exclusive. A dynamically typed language can be seen as a statically-typed languagewith a very permissive type system under which any syntactically correct program is well-typed; as long as its dynamic semantics ensures that no such program ever "goes wrong" in an appropriate sense, it satisfies the definition above and can be called type-safe.</blockquote>}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -