For example, a date could be stored as a record containing a numericyear field, a month field represented as a string, and a numeric day-of-month field. A circle record might contain a numeric radius and a center that is a point record containing x and y coordinates.
A record type is a data type that describes such values and variables. Most modern programming languages allow the programmer to define new record types. The definition includes specifying the data type of each field and an identifier (name or label) by which it can be accessed. In type theory, product types (with no field names) are generally preferred due to their simplicity, but proper record types are studied in languages such as System F-sub. Since type-theoretical records may contain first-class function-typed fields in addition to data, they can express many features of object-oriented programming.
A record is similar to a mathematicaltuple, although a tuple may or may not be considered a record, and vice versa, depending on conventions and the programming language. In the same vein, a record type can be viewed as the computer language analog of the Cartesian product of two or more mathematical sets, or the implementation of an abstract product type in a specific language.
A record differs from an array in that a record's elements (fields) are determined by the definition of the record, and may be heterogeneous whereas an array is a collection of elements with the same type.[6]
The parameters of a function can be viewed collectively as the fields of a record and passing arguments to the function can be viewed as assigning the input parameters to the record fields. At a low-level, a function call includes an activation record or call frame, that contains the parameters as well as other fields such as local variables and the return address.
History
The concept of a record can be traced to various types of tables and ledgers used in accounting since remote times. The modern notion of records in computer science, with fields of well-defined type and size, was already implicit in 19th century mechanical calculators, such as Babbage's Analytical Engine.[7][8]
The original machine-readable medium used for data (as opposed to control) was the punch card used for records in the 1890 United States Census: each punch card was a single record. Compare the journal entry from 1880 and the punch card from 1895. Records were well-established in the first half of the 20th century, when most data processing was done using punched cards. Typically, each record of a data file would be recorded on one punched card, with specific columns assigned to specific fields. Generally, a record was the smallest unit that could be read from external storage (e.g., card reader, tape, or disk). The contents of punchcard-style records were originally called "unit records" because punchcards had pre-determined document lengths.[9] When storage systems became more advanced with the use of hard drives and magnetic tape, variable-length records became the standard. A variable-length record is a record in which the size of the record in bytes is approximately equal to the sum of the sizes of its fields. This was not possible to do before more advanced storage hardware was invented because all of the punchcards had to conform to pre-determined document lengths that the computer could read, since at the time the cards had to be physically fed into a machine.
Most machine language implementations and early assembly languages did not have special syntax for records, but the concept was available (and extensively used) through the use of index registers, indirect addressing, and self-modifying code. Some early computers, such as the IBM 1620, had hardware support for delimiting records and fields, and special instructions for copying such records.
COBOL was the first widespread programming language to support record types,[10] and its record definition facilities were quite sophisticated at the time. The language allows for the definition of nested records with alphanumeric, integer, and fractional fields of arbitrary size and precision, and fields that automatically format any value assigned to them (e.g., insertion of currency signs, decimal points, and digit group separators). Each file is associated with a record variable where data is read into or written from. COBOL also provides a MOVECORRESPONDING statement that assigns corresponding fields of two records according to their names.
The early languages developed for numeric computing, such as FORTRAN (up to FORTRAN IV) and ALGOL 60, did not support record types; but later versions of those languages, such as FORTRAN 77 and ALGOL 68 did add them. The original Lisp programming language too was lacking records (except for the built-in cons cell), but its S-expressions provided an adequate surrogate. The Pascal programming language was one of the first languages to fully integrate record types with other basic types into a logically consistent type system. The PL/I language provided for COBOL-style records. The C language provides the record concept using structs. Most languages designed after Pascal (such as Ada, Modula, and Java), also supported records.
Although records are not often used in their original context anymore (i.e. being used solely for the purpose of containing data), records influenced newer object-oriented programming languages and relational database management systems. Since records provided more modularity in the way data was stored and handled, they are better suited at representing complex, real-world concepts than the primitive data types provided by default in languages. This influenced later languages such as C++, Python, JavaScript, and Objective-C which address the same modularity needs of programming.[11]Objects in these languages are essentially records with the addition of methods and inheritance, which allow programmers to manipulate the way data behaves instead of only the contents of a record. Many programmers regard records as obsolete now since object-oriented languages have features that far surpass what records are capable of. On the other hand, many programmers argue that the low overhead and ability to use records in assembly language make records still relevant when programming with low levels of abstraction. Today, the most popular languages on the TIOBE index, an indicator of the popularity of programming languages, have been influenced in some way by records due to the fact that they are object oriented.[12] Query languages such as SQL and Object Query Language were also influenced by the concept of records. These languages allow the programmer to store sets of data, which are essentially records, in tables.[13] This data can then be retrieved using a primary key. The tables themselves are also records which may have a foreign key: a key that references data in another table.
Record type
Operations
Operations for a record type include:
Declaration of a record type, including the position, type, and (possibly) name of each field
Declaration of a record; a variable typed as a record type
Construction of a record value; possibly with field value initialization
Read and write record field value
Comparison of two records for equality
Computation of a standard hash value for the record
Some languages provide facilities that enumerate the fields of a record. This facility is needed to implement certain services such as debugging, garbage collection, and serialization. It requires some degree of type polymorphism.
In contexts that support record subtyping, operations include adding and removing fields of a record. A specific record type implies that a specific set of fields are present, but values of that type may contain additional fields. A record with fields x, y, and z would thus belong to the type of records with fields x and y, as would a record with fields x, y, and r. The rationale is that passing an (x,y,z) record to a function that expects an (x,y) record as argument should work, since that function will find all the fields it requires within the record. Many ways of practically implementing records in programming languages would have trouble with allowing such variability, but the matter is a central characteristic of record types in more theoretical contexts.
Assignment and comparison
Most languages allow assignment between records that have exactly the same record type (including same field types and names, in the same order). Depending on the language, however, two record data types defined separately may be regarded as distinct types even if they have exactly the same fields.
Some languages may also allow assignment between records whose fields have different names, matching each field value with the corresponding field variable by their positions within the record; so that, for example, a complex number with fields called real and imag can be assigned to a 2D point record variable with fields X and Y. In this alternative, the two operands are still required to have the same sequence of field types. Some languages may also require that corresponding types have the same size and encoding as well, so that the whole record can be assigned as an uninterpreted bit string. Other languages may be more flexible in this regard, and require only that each value field can be legally assigned to the corresponding variable field; so that, for example, a short integer field can be assigned to a long integer field, or vice versa.
Other languages (such as COBOL) may match fields and values by their names, rather than positions.
These same possibilities apply to the comparison of two record values for equality. Some languages may also allow order comparisons ('<'and '>'), using the lexicographic order based on the comparison of individual fields.[citation needed]
PL/I allows both of the preceding types of assignment, and also allows structure expressions, such as a = a+1; where "a" is a record, or structure in PL/I terminology.
Algol 68's distributive field selection
In Algol 68, if Pts was an array of records, each with integer fields X and Y, one could write Y of Pts to obtain an array of integers, consisting of the Y fields of all the elements of Pts. As a result, the statements Y of Pts[3] := 7 and (Y of Pts)[3] := 7 would have the same effect.
Pascal's "with" statement
In Pascal, the command with R do S would execute the command sequence S as if all the fields of record R had been declared as variables. Similarly to entering a different namespace in an object-oriented language like C#, it is no longer necessary to use the record name as a prefix to access the fields. So, instead of writing Pt.X := 5; Pt.Y := Pt.X + 3 one could write withPtdobeginX:=5;Y:=X+3end.
Representation in memory
The representation of a record in memory varies depending on the programming language. Often, fields are stored in consecutive memory locations, in the same order as they are declared in the record type. This may result in two or more fields stored into the same word of memory; indeed, this feature is often used in systems programming to access specific bits of a word. On the other hand, most compilers will add padding fields, mostly invisible to the programmer, in order to comply with alignment constraints imposed by the machine—say, that a floating point field must occupy a single word.
Some languages may implement a record as an array of addresses pointing to the fields (and, possibly, to their names and/or types). Objects in object-oriented languages are often implemented in rather complicated ways, especially in languages that allow multiple class inheritance.
Self-defining records
A self-defining record is a type of record which contains information to identify the record type and to locate information within the record. It may contain the offsets of elements; the elements can therefore be stored in any order or may be omitted.[14] The information stored in a self-defining record can be interpreted as metadata for the record, which is similar to what one would expect to find in the UNIXmetadata regarding a file, containing information such as the record's creation time and the size of the record in bytes. Alternatively, various elements of the record, each including an element identifier, can simply follow one another in any order.
Key field
A record, especially in the context of row-based storage, may include key fields that allow indexing the records of a collection. A primary key is unique throughout all stored records; only one of this key exists.[15] In other words, no duplicate may exist for any primary key. For example, an employee file might contain employee number, name, department, and salary. The employee number will be unique in the organization and will be the primary key. Depending on the storage medium and file organization, the employee number might be indexed—that is also stored in a separate file to make the lookup faster. The department code is not necessarily unique; it may also be indexed, in which case it would be considered a secondary key, or alternate key.[16] If it is not indexed, the entire employee file would have to be scanned to produce a listing of all employees in a specific department. Keys are usually chosen in a way that minimizes the chances of multiple values being feasibly mapped to by one key. For example, the salary field would not normally be considered usable as a key since many employees will likely have the same salary.
See also
Block (data storage) – Sequence of bits or bytes of a maximum predetermined size
Composite data type – any data type which can be constructed in a program using the programming language's primitive data types and other composite typesPages displaying wikidata descriptions as a fallback
Data hierarchy – systematic organization of data in a hierarchical form showing relationships between smaller and larger componentsPages displaying wikidata descriptions as a fallback
Object composition – Method in computer programming of forming higher-level object types
^Edwin D. Reilly; Anthony Ralston; David Hemmendinger, eds. (2003). Encyclopedia of computer science (4th ed.). Chichester, UK: Wiley. ISBN978-1-84972-160-8. OCLC436846454.
Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada April 2012. Bloody Fight in Iron-Rock ValleySutradaraJi Ha JeanPemeranLee Moo SaengTanggal rilis 17 Juli 2011 (2011-07-17) (PIFAN) Durasi89 menitNegara Korea SelatanBahasaKorea Bloody Fight in Iron-Rock Valley adalah film Korea Selatan tahun 2011 yang disut...
محمد حسين عيسى معلومات شخصية تاريخ الميلاد 3 يونيه 1937 الوفاة 25 يونيو 2021 (83 سنة)الإسكندرية، مصر مواطنة مصر المواقع الموقع http://www.nfaes.com تعديل مصدري - تعديل الشيخ محمد حسين عيسي (3 يونيه 1937 - 25 يونيو 2021)، أحد رموز وقيادات الاخوان المسلمين في مصر وعضو مجلس شورى جماعة الاخوان ...
Artikel ini terlalu bergantung pada referensi dari sumber primer. Mohon perbaiki artikel ini dengan menambahkan sumber sekunder atau tersier. (Pelajari cara dan kapan saatnya untuk menghapus pesan templat ini) Winsor & NewtonJenisSwastaIndustriBahan seniDidirikan1832; 191 tahun lalu (1832) di LondonPendiriWilliam Winsor dan Henry NewtonKantorpusatLondon, InggrisWilayah operasiSeluruh duniaProdukCat akrilik, minyak, dan air, gouache, kuas, kanvas, kertas, tinta, pensil grafit, dan war...
Mosque in East Azerbaijan, Iran Jameh Mosque of AharReligionAffiliationShia IslamProvinceEast Azerbaijan ProvinceLocationLocationAhar, IranArchitectureTypeMosqueCompletedIlkhanate - Safavid dynasty Jameh Mosque of Ahar is related to the Ilkhanate - Safavid dynasty and is located in Ahar.[1][2][3] References ^ Encyclopaedia of the Iranian Architectural History. Cultural Heritage, Handicrafts and Tourism Organization of Iran. 19 May 2011. Archived from the original on 6 ...
Geographical region of Wisconsin This article is about the geographical region in north central United States. For the high school in New Jersey, see Northern Highlands Regional High School. For the region in Madagascar, see Northern Highlands. Northern Highlandclass=notpageimage| Location of the Northern Highlands in the United States Wisconsin can be divided into five geographic regions.[1] The Northern Highland is highlighted in yellow. The Northern Highland is a geographical regio...
Северный морской котик Самец Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:Синапси...
Keuskupan JacarezinhoDioecesis IacarezinhoënsisCatedral Nossa Senhora da Conceição e São Sebastião (2016)LokasiNegara BrazilProvinsi gerejawiLondrinaStatistikLuas13.369 km2 (5.162 sq mi)Populasi- Total- Katolik(per 2006)437.000380,000 (87.0%)InformasiRitusRitus LatinPendirian10 Mei 1926 (98 tahun lalu)KatedralCatedral Nossa Senhora da Conceição e São SebastiãoKepemimpinan kiniPausFransiskusUskupFernando José PenteadoEmeritusConrado Walter, S.A...
Arena football team Chicago BruisersEstablished 1987Folded 1989Played in Rosemont Horizon in Rosemont, Illinois League/conference affiliationsArena Football League (1987–1989)Current uniformTeam colorsBlack, light blue, white PersonnelHead coachGeorge BrancatoTeam history Chicago Bruisers (1987–1989) ChampionshipsLeague championships (0)Conference championships (0)Prior to 2005, the AFL did not have conference championship gamesDivision championships (0)Prior to 1992, t...
Georgian journalist, intellectual, revolutionary and politician Noe Zhordaniaნოე ჟორდანიაZhordania in 1920Head of the Government of the Democratic Republic of Georgia in ExileIn office18 March 1921 – 11 January 1953Preceded byHimself as Prime Minister of GeorgiaSucceeded byGovernment in Exile dissolved2nd Prime Minister of GeorgiaIn office24 June 1918[1] – 18 March 1921Preceded byNoe RamishviliSucceeded byBudu Mdivani (As Chairman of the Cou...
International agreement attempting to regulate activities on the Moon and other celestial bodies Moon TreatyAgreement Governing the Activities of States on the Moon and Other Celestial BodiesSignedDecember 18, 1979LocationNew York, USAEffectiveJuly 11, 1984Condition5 ratificationsSignatories11[1]Parties17[2][1] (as of May 2024)DepositarySecretary-General of the United NationsLanguagesEnglish, French, Russian, Spanish, Arabic and ChineseFull text Moon Treaty at Wikisour...
MoroccoMoroccan Cricket Federation LogoPersonnelCaptainAl Amin ShehzadCoachNoneInternational Cricket CouncilICC statusExpelled (2019)[1] (ICC member: 1999–2019)ICC regionAfricaInternational cricketFirst international23 April 2006 v Rwanda at Willowmoore Park, Benoni, South AfricaAs of 31 May 2012 The Moroccan national cricket team was the team that represented the Kingdom of Morocco in international cricket. The team is governed by Federation Royale Marocaine De Cricket. In Apr...
Soeparno Kepala Staf TNI Angkatan Laut ke-23Masa jabatan28 September 2010 – 17 Desember 2012PresidenSusilo Bambang YudhoyonoWakilMarsetioPendahuluAgus SuhartonoPenggantiMarsetio Informasi pribadiLahir28 September 1955 (umur 68)Surabaya, Jawa TimurAlma materAKABRI (1978)PekerjaanTentaraKarier militerPihak IndonesiaDinas/cabang TNI Angkatan LautMasa dinas1978–2013Pangkat Laksamana TNISatuanKorps PelautSunting kotak info • L • B Laksamana TNI (Purn.)...
لمعانٍ أخرى، طالع مطر (توضيح). مطرمعلومات عامةصنف فرعي من هطول الاستعمال القائمة ... طاقة كهرمائية[1][2] زراعة إمداد المياه تشييد غسل الملابس جانب من جوانب طقس تسبب في فيضانماء المطر لديه جزء أو أجزاء قطرة تعديل - تعديل مصدري - تعديل ويكي بيانات جزء من سلسلة مق...
В Википедии есть статьи о других людях с такой фамилией, см. Соколов.Тарас Николаевич Соколов Дата рождения 4 (17) апреля 1911(1911-04-17) Место рождения Кугульта, Ставропольская губерния, Российская империя Дата смерти 15 августа 1979(1979-08-15) (68 лет) Место смерти Ленинград, РСФСР,...
Salah satu aplikasi schlieren pada gelombang kejut (shockwave) pada pesawat yang melaju di atas kecepatan suara (v > 1 Mach) Schlieren (Jerman : 'guratan') adalah salah satu metode optika-fluida sebagai akibat dari ketidaksamaan dan bersifat tidak kasat mata yang umum digunakan di dalam analisis fluida. Referensi
Pour les articles homonymes, voir Traité. Jimmy Carter et Léonid Brejnev signent le traité Salt II à Vienne le 18 juin 1979. Un traité est un contrat conclu entre plusieurs sujets de droit international public. L'accord écrit traduit l'expression des volontés concordantes de ces sujets de droit en vue de produire des effets juridiques contraignants, qui sont régis par le droit international. Définition Un traité est un contrat qui est conclu entre plusieurs sujets de droit internat...
川崎医療短期大学 川崎医療短期大学大学設置/創立 1973年学校種別 私立設置者 学校法人学校法人川崎学園本部所在地 岡山県岡山市北区中山下二丁目1番70号学部 看護学科[1]医療介護福祉学科[2][注 1]ウェブサイト https://j.kawasaki-m.ac.jp/テンプレートを表示 川崎医療短期大学(かわさきいりょうたんきだいがく、英語: Kawasaki College of Health Professions)は、岡山県岡山市北...
Public research university in Mexico National Autonomous University of MexicoUniversidad Nacional Autónoma de MéxicoLatin: Universitas MexicanaFormer namesNational University of Mexico (1910–1929)MottoPor mi raza hablará el espírituMotto in EnglishThrough my race shall the spirit speakTypePublic research universityEstablished22 September 1910[1][2][3][4][5][6]FounderJusto SierraPorfirio DíazEndowmentUS$3.0 billion (2023)[7]Re...
Spanish architect In this Spanish name, the first or paternal surname is Eusa and the second or maternal family name is Razquin. Víctor Eusa RazquinBornVíctor Eusa Razquin1894Pamplona, SpainDied1990 (aged 95–96)Pamplona, SpainNationalitySpanishOccupationarchitectKnown forarchitectPolitical partyCarlism Víctor Eusa Razquin (1894–1990) was a Spanish architect, active almost exclusively in Navarre; he left his personal mark on Pamplona, which hosts numerous prestigio...