ExternalTypeSignature

ExternalTypeSignature

is an option for EmbedCode that gives rules specifying the mapping to external types in an embedded code.

Details

  • ExternalTypeSignature->{{"var1"->"type1",},"rettype"} specifies that vari should be of external type typei, and that the return type for the whole function should be rettype.
  • ExternalTypeSignature->{{"type1","type2",},"rettype"} takes the n^(th) argument to be of type typen.
  • The typei are native types specified as they are named in the target language.
  • In many languages, possible external types include: "int", "double", "string".
  • The types of arguments can often be inferred from other data in APIFunction etc. where they appear. A type of Automatic will use the inferred form.
  • In languages where types are used, the return type typically has to be set explicitly.
  • ExternalTypeSignature->"rettype" specifies the return type, and if possible infers all argument types.
  • In languages with dynamic typing, or without types, types do not usually have to be set.

Examples

Basic Examples  (1)

Create a cloud object:

Generate a complete Java file to call the cloud object that can be pasted into a Java project:

The types of arguments can often be deduced automatically. The return type must be specified explicitly:

Wolfram Research (2014), ExternalTypeSignature, Wolfram Language function, https://reference.wolfram.com/language/ref/ExternalTypeSignature.html.

Text

Wolfram Research (2014), ExternalTypeSignature, Wolfram Language function, https://reference.wolfram.com/language/ref/ExternalTypeSignature.html.

CMS

Wolfram Language. 2014. "ExternalTypeSignature." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ExternalTypeSignature.html.

APA

Wolfram Language. (2014). ExternalTypeSignature. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ExternalTypeSignature.html

BibTeX

@misc{reference.wolfram_2024_externaltypesignature, author="Wolfram Research", title="{ExternalTypeSignature}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ExternalTypeSignature.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_externaltypesignature, organization={Wolfram Research}, title={ExternalTypeSignature}, year={2014}, url={https://reference.wolfram.com/language/ref/ExternalTypeSignature.html}, note=[Accessed: 22-November-2024 ]}