O Language: Functions and Literals

The only difference between functions and literatures is that one of the brackets can be operated without parentheses. In this way you can define your own definitions.

Functions

The system has function definition function. These functions can be used many times.

def main = fn(param){
    return param
};

main("Hello!"); 
# => main function result:"Hello!"

Literals

You benefit by creating static functions directly in the system literature.

literal example(param){
   println(param)
}

main "Hello!"
# => main literal result:"Hello!"

Now we can begin to learn scope definitions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.