BubbleLang/Keywords
Jump to navigation
Jump to search
Keyword List
| CMD | Meaning |
|---|---|
| False | Logical 0. |
| None | A nil constant. |
| True | Logical 1. P.S.: True+True=2 |
| if | If-statement. |
| elif | Equal el(se )if. |
| else | If-else final statement. |
| var | Define variable. |
| const | Define constant. |
| import | Import a library externally. |
| from | Import all (or partial) declarations and definitions from the Standard Library. |
| int, float, and so on | See BubbleLang#Types. |
| for | Iterative loops. |
| while | Conditional loops. |
| continue | Abort this cycle and proceed to the next round. |
| break | Jump straight out of the loop. |
| try | Attempted execution of code that may cause an error. |
| except | Specifies the code to run if the code inside the try statement block does throw an error. |
| finally | Regardless of whether the statements in the try block are successfully executed or not, the statements in the finally block will be executed. |
| in | Returns True if the element appears in a list/tuple (or a key-value pair appears in a dictionary), otherwise False. |
| assert | Similar to an if-else statement block, but if the condition (assertion) is not true, an assertion error is raised. |
| lambda | You should know lambda expressions, right? |
| global | If there is a variable with the same name as the global variable, the global variable is called instead of the local variable. |
| function | Define function. |
| class | Define object. |
| raise | Throw an error directly. |
| pass | Something that can act as a placeholder. |
| with | If you don't put the actions you want to perform after opening the file in the with block, it will lead to fatal consequences: you will not be able to close the file in time after the error occurs. |
| return | Return a value. |
| delete | Delete a variable. |
| undefine | Similar to a delete statement, but deleting (dedefining) a function (or an object). |
| and | Only when both conditions are true will it return to True. |
| or | As long as one condition is true, it returns to True. |
| not | If the condition is True, return False. |
| bwand | Only if one of the binary bits of both operands is 1, the resulting binary bit is set to 1. |
| bwor | As long as one of the binary bits of an operand is 1, the corresponding binary bit of the result is set to 1. |
| bwnot | If the operand is x and the result is y, then y = (-x)-1. |
| bwxor | If one of the binary bits of the two operands is the same, the corresponding binary bit of the result is set to 0. |
| shiftl | Shift to the left, and shift x bits is multiplied by 2 to the xth power. |
| shiftr | Shift to the right, and shift x bits is divided by 2 to the xth power(integer division). |