CompilerEnvironmentAppendTo[{def1,def2,…}]
appends declarations to $CompilerEnvironment.
CompilerEnvironmentAppendTo[env,{def1,def2,…}]
appends declarations to CompilerEnvironmentObject env.
CompilerEnvironmentAppendTo
CompilerEnvironmentAppendTo[{def1,def2,…}]
appends declarations to $CompilerEnvironment.
CompilerEnvironmentAppendTo[env,{def1,def2,…}]
appends declarations to CompilerEnvironmentObject env.
Details
- CompilerEnvironmentAppendTo works with FunctionDeclaration to append function declarations to a CompilerEnvironmentObject.
- CompilerEnvironmentAppendTo works with TypeDeclaration to append function declarations to a CompilerEnvironmentObject.
- Declarations can be given with CompiledComponent objects.
Examples
Basic Examples (2)
Create a compiler environment and append a function declaration:
env = CreateCompilerEnvironment[];
CompilerEnvironmentAppendTo[env, {FunctionDeclaration[AddTwo, Typed[{"Integer64"} -> "Integer64"]@Function[arg, 2 + arg]]}];Use the new compiler environment in a compilation:
cf = FunctionCompile[Function[{Typed[arg, "Integer64"]}, AddTwo[arg]], CompilerEnvironment -> env]The compilation uses the function declaration:
cf[10]Use CompilerEnvironmentAppendTo with the default compiler environment:
CompilerEnvironmentAppendTo[{
FunctionDeclaration[AddTwo, Typed[{"Integer64"} -> "Integer64"]@Function[arg, 2 + arg]]}];Now there is no need to use the CompilerEnvironment option:
cf = FunctionCompile[Function[{Typed[arg, "Integer64"]}, AddTwo[arg]]];cf[1]The default compiler environment can be restored to its default state:
$CompilerEnvironment = CreateCompilerEnvironment[];Tech Notes
Related Guides
History
Text
Wolfram Research (2021), CompilerEnvironmentAppendTo, Wolfram Language function, https://reference.wolfram.com/language/ref/CompilerEnvironmentAppendTo.html.
CMS
Wolfram Language. 2021. "CompilerEnvironmentAppendTo." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CompilerEnvironmentAppendTo.html.
APA
Wolfram Language. (2021). CompilerEnvironmentAppendTo. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CompilerEnvironmentAppendTo.html
BibTeX
@misc{reference.wolfram_2026_compilerenvironmentappendto, author="Wolfram Research", title="{CompilerEnvironmentAppendTo}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/CompilerEnvironmentAppendTo.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_compilerenvironmentappendto, organization={Wolfram Research}, title={CompilerEnvironmentAppendTo}, year={2021}, url={https://reference.wolfram.com/language/ref/CompilerEnvironmentAppendTo.html}, note=[Accessed: 13-June-2026]}