encyclopegia.org

Tag (programming)

In programming, a tag is an argument to a subroutine that determines other arguments passed to it, which is used as a way to pass indefinite number of tagged parameters to the subroutine; notably, tags are used for a number of system calls in AmigaOS v2.0 and onwards.

In programming, a tag is an argument to a subroutine that determines other arguments passed to it, which is used as a way to pass indefinite number of tagged parameters to the subroutine; notably, tags are used for a number of system calls in AmigaOS v2.0 and onwards. ==In AmigaOS== In earlier versions of AmigaOS, if a system call required setting a large number of parameters, instead of passing them as function arguments, the function would require a pointer to a structure that holds the arguments (for example, intuition.library's OpenWindow() required struct NewWindow with 17 different parameters). Tags were introduced in AmigaOS 2.0 because they "make it possible to add new parameters to system functions without interfering with the original parameters. They also make specifying parameter lists much clearer and easier." A number of third-party software libraries for AmigaOS also use tags extensively. ===Example=== The code without tags is obscure (for example, 0, 1 define window colors) while the code with tags is self-documenting. Fewer parameters have to be defined with tags than are in the structure, as OpenWindowTags will fall back to default parameters. ===Implementation=== AmigaOS provides functions for tag handling in its utility.library . Especially Amiga E provides mechanisms for dynamic tag handling, allowing programs to manipulate structures where tags are not known until runtime. This is achieved through various dynamic data structures and associated functions. ==In general== An advantage of tags is that they ease the work with default arguments since the programmer doesn't have to specify them or their substitutes. From this follows another advantage, ease of achieving of both forward and backward compatibility with external libraries: a program written for an older version of the library will work with a newer one, since the newer library will simply set all the parameters not provided by the program to their default values; and a program written for a newer version of the library will still work with the older version, since the older library will simply pay no attention to the newly introduced tags. A disadvantage of tags is that their processing is slower than simply reading data from a structure or the stack. Additionally, compile time type checking is lost. ==See also== Named parameter ==References== ==External links== utility.library autodoc Amiga ROM Kernal Reference Manual: Libraries - Tag index

References

No reference rows published for this article.

Cite this article

MLA

"Tag (programming)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/tag-programming. Accessed 24 November 2026.

Chicago

"Tag (programming)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/tag-programming.

APA

encyclopegia.org. (2026). Tag (programming). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/tag-programming

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Bab Al-Sharqi

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1346712152 · 0.5 · snapshot enwiki-001346712152

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.