Strong Typing Strong Typing static type checking strongly

  • Slides: 10
Download presentation
Strong Typing

Strong Typing

Strong Typing • 컴파일 과정에서 모든 형 검증이 끝나는 (static type checking) 언어를strongly typed언어라고

Strong Typing • 컴파일 과정에서 모든 형 검증이 끝나는 (static type checking) 언어를strongly typed언어라고 한다. • Algol 68은 strongly typed 언어이지만, PASCAL은 아니다. 2

Algol • Algol 68은 그와 같은 문제가 발생하지 않는다 – proc who_knows = (

Algol • Algol 68은 그와 같은 문제가 발생하지 않는다 – proc who_knows = ( int i, int j, proc(bool) void f) void : begin bool k; k : = j < i; if k then f(k) else f(j) error !!! fi end 4

형 일치(Type compatibility) • 프로그램의 예 – type t = array[1. . 20] of

형 일치(Type compatibility) • 프로그램의 예 – type t = array[1. . 20] of integer; var a, b : array[1. . 20] of integer; c : array[1. . 20] of integer; d : t e, f : record a : integer; b : t end 8