
reference.language.code.html Maven / Gradle / Ivy
Code expressions
Code expressions
Code expressions are expressions used to convey Prompto code fragments.
A code expression is a code fragment which produces a Code value, which can then be used as an input for code invocations.
A code expression has the form Code: code
, where code
is a fragment of Prompto code.
Code values are not storable.
In the below example, we declare a method myMethod
which accepts Code code
as a parameter type.
In the main
method, we instantiate a Code expression, which is then used as a parameter when calling myMethod
.
For security reasons, Code expressions can only be created from Prompto code, not from text.
This ensures that methods receiving Code parameters are fully checked at compile time.
A method receiving Code parameters can be seen as a Method template, instantiated when called whith the actual Code expression.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy