Predeclared

Predeclared

In computer languages, the term pre-declared refers to built-in information, encodings or tools that are available to a programmer, often in the form of entities, variables, objects, functions or instructions. It is mostly not possible to overwrite or otherwise manipulate them.

Pre-declared entity

A pre-declared entity is a built-in notation convention for a character or a string. For example, in the HTML markup language, a large number of character and numeric entities are available to represent characters. In HTML, '&amp;lt;' is a possible pre-declared entity to represent '<'. The programmer must not declare this entity by himself before he can use it, since it is already pre-declared by the specifications of the HTML language. Pre-declared entities are often used as escape sequences to represent information that would otherwise cause possible conflicts in its non-encoded form.

Pre-declared variable

When a variable is pre-declared, it provides the programmer with information that he might be interested in. For example, in the Perl language, a variable %ENV is pre-declared, holding all kinds of environmental information such as the operating system, host information, user information, and many more. Other pre-declared variables in Perl are %INC and %SIG. Almost all common programming languages provide the programmer with such pre-declared variables in one or another form.

When variables are pre-declared, it is commonly assumed that the value for the pre-declared name is also pre-assigned at the same time.

Pre-declared object

Pre-declared objects have the same goal as pre-declared variables. For example, in the javascript language, the navigator-object is available to get all kinds of information about the browser that is running the script in question.

Pre-declared functions and instructions

Pre-declared functions or instructions are built-in tools to perform common tasks. For example, in the earliest programming languages the square root needed to be calculated by hand. Nowadays programming languages have a pre-declared instruction or function for this task. Pre-declared functions or instructions often hold common tasks and their goal is to simplify the work of the programmer. The available pre-declared instructions or functions can in some languages be extended by using external libraries or modules.

Narrow semantic sense

In a narrow strictly semantic sense, the term pre-declared may also refer to the declaration of a variable before an assignment takes place. In the following example, the first line is the (pre-)declaration and the second the assignment:

var A; A = 1;

By declaring the name A, the program creates a namespace for the variable called A. In most modern languages, the variable does not need to be pre-declared on a separate line, as the following instruction achieves exactly the same:

var A = 1;

In early computer languages, the variable always needed to be pre-declared as a separate instruction, because the operating system had to reserve a series of bytes in the available RAM, before the actual value of the variable could be stored in it. Declaration and assignment are still two fundamental different things, though they nowadays mostly appear in a same instruction line.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • XML — Infobox file format name = Extensible Markup Language icon = logo = extension = .xml mime = application/xml, text/xml (deprecated) type code = uniform type = public.xml magic = owner = World Wide Web Consortium genre = Markup language container… …   Wikipedia

  • Control flow — Not to be confused with Flow control. In computer science, control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions, or function calls of an imperative or a declarative program are… …   Wikipedia

  • IDL (programming language) — Infobox programming language name = IDL (Interactive Data Language) paradigm = vectorized year = 1977 designer = David Stern developer = David Stern Research Systems, Inc. (RSI) latest release version = IDL 7.0 latest release date = 2007 typing …   Wikipedia

  • predeclare — v.t., predeclared, predeclaring. * * * …   Universalium

  • встроенная функция — — [Л.Г.Суменко. Англо русский словарь по информационным технологиям. М.: ГП ЦНИИС, 2003.] Тематики информационные технологии в целом EN predeclared function …   Справочник технического переводчика

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”