Functions in SRON
{
name : Main
}{
name : function_name
args : (Any value)
@ the 'name' attribute is used to name a function.
@ the 'args' attribute is used to declare the arguments of the function.
}You can also set the argument types for the function, like this:
{
name : char_value
args : (Int __val)
type : Int
return __val
}
{
name : Main
@ the passed argument 'A' is automatically converted to
@ integer in char_value() function
println(char_value('A')) @ Output: 65
}What if you want strict type checking such that if the passed argument is not same as the specified type, then code will not run. For this, SRON provides strict argument keywords:
SRON provides 6 strict argument keywords:
SRON provides abundant amount of in-built functions to work on data efficiently and easily without explicitly code them.
Calling functions in sub-directories
Last updated