关于type check的定义
2014-04-01 15:05
459 查看
Concept: Type Checking
There is no static type checking in Scheme; type checking is done at run time.
There is unfortunately little agreement about many of the terms which are associated with type checking: so I'll give you the definitions we'll use in class, while pointing out some of the other interpretations.
Type safeType safe means that the language guarantees that one type can't be incorrectly used in place of another type, in other words, that all expressions are guaranteed to be type consistent. This can be done checked statically, dynamically, or a mixture. Scheme, Ada, Smalltalk, and Prolog are examples of type safe languages. Fortran and C are examples of languages that aren't type safe.Static/Dynamic type checkingThis refers to when type checking occurs. Static type checking takes place during compilation, dynamic type checking takes place at run-time. This distinction makes no guarantee about the completeness of the type checking. Ada is a statically typed, type-safe language, which is to say that the necessary type checking takes place at compile time. (This was true at least of the old Ada, Ada 95 appears to support dynamic binding, so I'm not certain if it can do all checking statically.) C is also statically typed, but not type safe. Scheme is dynamically typed and type safe. (Some texts use statically typed to imply type safe, but I think this is confusing, because we should be separating out the issues of the completeness of the type checking (type safety) from the time when the type checking occurs (dynamic vs. static).)Strongly typedThere are two common definitions for strongly typed (sorry) -- one is strongly typed = statically typed and type safe; the other is strongly typed = type safe. I will attempt to use the latter definition. Scheme and Ada are strongly typed by this definition.Weakly typedWeakly typed means "not type safe". Fortran and C are examples of weakly typed languages.
转自:http://courses.cs.washington.edu/courses/cse341/02wi/scheme/basics.html
There is no static type checking in Scheme; type checking is done at run time.
There is unfortunately little agreement about many of the terms which are associated with type checking: so I'll give you the definitions we'll use in class, while pointing out some of the other interpretations.
Type safeType safe means that the language guarantees that one type can't be incorrectly used in place of another type, in other words, that all expressions are guaranteed to be type consistent. This can be done checked statically, dynamically, or a mixture. Scheme, Ada, Smalltalk, and Prolog are examples of type safe languages. Fortran and C are examples of languages that aren't type safe.Static/Dynamic type checkingThis refers to when type checking occurs. Static type checking takes place during compilation, dynamic type checking takes place at run-time. This distinction makes no guarantee about the completeness of the type checking. Ada is a statically typed, type-safe language, which is to say that the necessary type checking takes place at compile time. (This was true at least of the old Ada, Ada 95 appears to support dynamic binding, so I'm not certain if it can do all checking statically.) C is also statically typed, but not type safe. Scheme is dynamically typed and type safe. (Some texts use statically typed to imply type safe, but I think this is confusing, because we should be separating out the issues of the completeness of the type checking (type safety) from the time when the type checking occurs (dynamic vs. static).)Strongly typedThere are two common definitions for strongly typed (sorry) -- one is strongly typed = statically typed and type safe; the other is strongly typed = type safe. I will attempt to use the latter definition. Scheme and Ada are strongly typed by this definition.Weakly typedWeakly typed means "not type safe". Fortran and C are examples of weakly typed languages.
转自:http://courses.cs.washington.edu/courses/cse341/02wi/scheme/basics.html
相关文章推荐
- FCKeditor关于图片上传出现错误“ 提示没有权限 Type=Image” 以及出现"this connector is disabled Please check the"editor/filemanager/connectors/aspx/conf
- linux内核中关于MACH_TYPE_OMAP_4430SDP的定义
- 关于VB.NET记录定义Type用法介绍
- 关于"MDRV: cannot find lrun root directory . Please check your M_LROOT"问题解决
- 关于打包签名时 出现错误---Error:Error: Expected resource of type styleable [ResourceType]
- 关于类的定义(续)
- 关于js中二维数据的定义
- Asp.net 关于错误提示 类型“XXX1”在未被引用的程序集中定义,必须添加对程序集XXX2的引用
- 关于Service Identification,SOA服务划分和定义
- 微信小程序开发关于分享功能中怎么定义同一个页面中不同的按钮触发不同的分享内容,或者右上角的分享和页面中分享
- 关于语法节点Tree、类型Type和符号Symbol
- windows7下解决caffe check failed registry.count(type) == 1(0 vs. 1) unknown layer type问题
- 关于外部样式表定义背景图的问题
- 关于osworkflow流程定义时设置关闭的方法
- MyBatis中关于resultType和resultMap的区别
- 关于开发角色的定义
- ABAP--关于ABAP流程处理的一些命令的说明(stop,exit,return,check,reject)
- C++关于声明、定义、初始化的理解
- 关于VS2008编译错误"error LNK2005: 已经在 .obj 中定义"
- ok6410 学习1-----关于ads VIC_MODE定义