Prism's Features
Prism does not support recursion in all cases. It needs to be implemented in a specific way for it to work. Additionally, the language's standard library is not yet fully developed, and string support is not yet available. We are actively working to improve these language features, and we plan to add full recursion support and a more comprehensive standard library in future versions.
Here is an example to show how to make a recursive function:
You need to stock the argument passed to the function if you want to use it again after the function call in the body. .For further explannation, in the case above you can't do ret (a * d)
.
You can have below other important mentions about Prism language:
Mutable Variables by Default
In Prism, variables are mutable by default. This means that their values can be changed or reassigned after their initial declaration. This flexibility allows for dynamic updates of variables values throughout the program.
Dynamic Typing
Prism is dynamically typed, this means that variable types are not explicitly declared and can change during runtime. The type of a variable is determined by the value assigned to it at any given point in the program.
Immutable Function Parameters
In Prism, function parameters are immutable. Once a value is passed as a parameter to a function, it cannot be modified within the function body. It ensures that the function operates on the provided values without unintended side effects. If a modification is required, a new variable must be created and assigned the updated value.
Command-Line Arguments
Prism does not currently support command-line arguments. Any arguments passed through the command line when executing a Prism program are not taken into account.
About the "main" Function
In Prism, the main
function must be the last function defined in the file. This convention ensures that the program's entrypoint is easily identifiable and simplifies the execution flow. By placing the main
function at the end of the file, it becomes the starting point for program execution.
Last updated