Uncategorized / December 29, 2022

You are already a programmer

You are already a programmer. Give us 5 minutes, you will then know green tea programming language. Variables are $, functions are @. $number : 3 @echo_hello_world @echo “Hello world” (@echo_hello_world) > Hello World Green Tea blocks of commands are indent-based. Just like Python, but you can mix spaces and tabs. if $a < 0

Read More
Uncategorized / December 29, 2022

Class

Classes are “template” to create objects. Class define methods (functions) and properties (variables) of object. Class start with ^ To access object’s assets, use dot operator. Ex: ^Human $name $email @print_info @echo “$name – $email \n” Then we could create object $people_1 :(@new ^Human) $people_1.$name: John $people_1.$email: “[email protected]” $people_1.(@print_info) > John – [email protected] Constructors Constructors

Read More
Uncategorized / December 29, 2022

Multi threading

Green Tea support multi threading processing. Includes: File-based multi-threading (simple) Function-based multi-threading, Vars will not be shared among threads, you must use parameters and return values to exchange data among threads. File based multi threading Use @create_file_thread function to create a thread that execute another file. On thread file, you could return value to main

Read More
Uncategorized / December 29, 2022

Error handlers

Green Tea provide 2 ways to handle error: error_handler_function try…catch…finally structures defcat…deffin (default catch) error_handler_function You could declare this function to handle how to show when unhamdled error happened @error_handler_function($errno, $errstr, $errfile, $errline) //do somethings errno The first parameter, errno, will be passed the level of the error raised, as an integer. errstr The second

Read More