Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Variadic function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===In Pascal=== [[Pascal (programming language)|Pascal]] is standardized by [[International Organization for Standardization|ISO]] standards 7185 (“Standard Pascal”) and 10206 (“Extended Pascal”). Neither standardized form of Pascal supports variadic routines, ''except'' for certain [[Intrinsic function|built-in routines]] ({{code|read|pascal}}/{{code|readLn|pascal}} and {{code|write|pascal}}/{{code|writeLn|pascal}}, and additionally in {{abbr|EP|Extended Pascal}} {{code|readStr|pascal}}/{{code|writeStr|pascal}}). Nonetheless, ''dialects'' of Pascal implement mechanisms ''resembling'' variadic routines. [[Delphi (programming language)|Delphi]] defines an {{code|array of const|delphi}} data type that may be associated with the ''last'' [[formal parameter]]. Within the routine definition the {{code|array of const|delphi}} is an {{code|array of TVarRec|delphi}}, an [[Array (data type)|array]] of [[variant record]]s.<ref name="delphi">{{cite web|url=https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Parameters_(Delphi)#Variant_Open_Array_Parameters|title=Parameters (Delphi)|access-date=2023-08-28}}</ref> The {{code|VType|delphi}} member of the aforementioned {{code|record|delphi}} data type allows inspection of the argument’s data type and subsequent appropriate handling. The [[Free Pascal Compiler]] supports Delphi’s variadic routines, too.<ref name="fpc">{{cite web|url=https://www.freepascal.org/docs-html/3.2.0/ref/refsu68.html|title=Free Pascal - Reference guide|access-date=2023-08-28}}</ref> This implementation, however, technically requires a ''single'' argument, that is an {{code|array|pascal}}. Pascal imposes the restriction that arrays need to be homogenous. This requirement is circumvented by utilizing a variant record. The [[GNU Pascal]] defines a real variadic formal parameter specification using an ellipsis ({{code|...|pascal}}), but as of 2022 no portable mechanism to use such has been defined.<ref name="gpc">{{cite web|url=https://www.gnu-pascal.de/gpc/Special-Parameters.html|title=The GNU Pascal Manual|access-date=2023-08-28}}</ref> Both GNU Pascal and FreePascal allow externally declared functions to use a variadic formal parameter specification using an ellipsis ({{code|...|pascal}}).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)