오브젝트 파스칼
위키백과, 우리 모두의 백과사전.
| 패러다임 | 명령형 절차적 구조적 객체지향적 |
|---|---|
| 영향을 받은 언어 | 파스칼 |
| 운영 체제 | 크로스 플랫폼 |
오브젝트 파스칼(Object Pascal)은 파스칼에 객체 지향 개념을 포함하여 발전시킨 프로그래밍 언어이다. 주로 델파이 언어로도 잘 알려져 있다.
애플 매킨토시의 전신인 애플 리자용으로 개발한 오브젝트 파스칼 컴파일러가 시초이며, 가장 널리 알려진 오브젝트 파스칼의 변종은 볼랜드/코드기어 사의 델파이에서 사용되는 '델파이 프로그래밍 언어'가 있다. 볼랜드/코드기어 외 제품으로서는 자유 소프트웨어로 개발되는 델파이와 매우 닮은 프리 파스칼도 거의 유사한 문법을 가지고 있다.
목차 |
Hello World 프로그램[편집]
애플의 오브젝트 파스칼[편집]
program ObjectPascalExample; type THelloWorld = object procedure Put; end; var HelloWorld: THelloWorld; procedure THelloWorld.Put; begin WriteLn('Hello, World!'); ReadLn; end; begin New(HelloWorld); HelloWorld.Put; Dispose(HelloWorld); end.
터보 파스칼[편집]
program ObjectPascalExample; type PHelloWorld = ^THelloWorld; THelloWorld = object procedure Put; end; var HelloWorld: PHelloWorld; { this is a pointer to a THelloWorld } procedure THelloWorld.Put; begin WriteLn('Hello, World!'); end; begin New(HelloWorld); HelloWorld^.Put; Dispose(HelloWorld); end.
델파이, 프리 파스칼[편집]
program ObjectPascalExample; type THelloWorld = class procedure Put; end; procedure THelloWorld.Put; begin Writeln('Hello, World!'); end; var HelloWorld: THelloWorld; { this is an implicit pointer } begin HelloWorld := THelloWorld.Create; { constructor returns a pointer } HelloWorld.Put; HelloWorld.Free; { this line dereferences the pointer } end.
같이 보기[편집]
| 이 글은 소프트웨어에 관한 토막글입니다. 서로의 지식을 모아 알차게 문서를 완성해 갑시다. |