레코드 (컴퓨터 과학)
보이기
(사용자 정의 자료형에서 넘어옴)
컴퓨터 과학에서 레코드(record) (Struct 나 사용자 정의 타입(User Defined Types) 이라고도 한다.)는 각기 다른 자료형에 속할 수 있는 필드의 모임이며, 문자열, 정수, 시퀀스 등 사용자 정의에 따라 여러가지가 들어가 있다.[1]
데이터베이스나 스프레드시트의 레코드는 보통 로우(row)라고 부른다.[2][3][4][5]
레코드의 필드들은 객체 지향 프로그래밍에서 멤버(member)로도 부른다. 레코드 자료형은 현대프로그래밍 언어에서 필드의 값으로 일급함수를 포함 할 수 있다.
예시
[편집]다음은 레코드 정의의 예를 보여준다.
- PL/I:
declare 1 date, 2 year fixed binary, 2 month fixed binary, 2 day fixed binary; - Algol 68:
mode date = struct (int year, int month, int day);
- C:
struct date { int year; int month; int day; };
- Go:
type Date struct { year int month time.Month day int }
- 파스칼:
type TDate = record Year: Integer; Month: 1..12; Day: 1..31; end;
- 러스트:
struct Date { year: u32, month: u32, day: u32, }
- 하스켈:
data Date = Date { year :: Integer , month :: Integer , day :: Integer }
- 줄리아:
struct Date year::Int month::Int day::Int end
- Standard ML:
type date = {year:int, month:int, day:int}
같이 보기
[편집]각주
[편집]- ↑ Felleisen, Matthias (2001). 《How To Design Programs》. MIT Press. 53,60쪽. ISBN 978-0262062183. 2018년 9월 23일에 확인함.
- ↑ “Computer Science Dictionary Definitions”. 《Computing Studenta》. 2021년 1월 24일에 원본 문서에서 보존된 문서. 2018년 1월 22일에 확인함.
- ↑ Radványi, Tibor (2014). 《Database Management Systems》. Eszterházy Károly College. 19쪽. 2018년 9월 23일에 확인함.
- ↑ Kahate, Atul (2006). 《Introduction to Database Management Systems》. Pearson. 3쪽. ISBN 978-81-317-0078-5. 2018년 9월 23일에 확인함.
- ↑ Connolly, Thomas (2004). 《Database Solutions: A Step by Step Guide to Building Databases》 2판. Pearson. 7쪽. ISBN 978-0-321-17350-8. 2018년 9월 23일에 확인함.