Oneline
Jump to navigation
Jump to search
- Not to be confused with OneLine.
Oneline is an object-oriented stack-based esoteric programing language designed to be as compressed as possible.
Instructions
Character | Function |
---|---|
{ | Starts a class |
} | Ends a class |
[ | Starts a function |
] | Ends a function |
( | Starts a codeblock |
) | Ends a codeblock |
:identifier | Pops a value and saves it in a property |
instance%property | Pushes the property's value. If the instance is ommited, it will be refered to this intance |
_ | While loop |
? | If |
, | Else |
# | Number |
@t/@f | True/False |
+ | Pop two numbers and add them together, or pop two characters and combine them to form a string |
- | Pop two numbers and substract them together |
* | Pop two numbers and multiply them together |
/ | Pop two numbers and divide them together |
$ | Pop a number and push and character with that ASCII code |
O | Pop a value and print it |
I | Read a value from the user input and push it |
Syntax
- Create function:
[statements]
- Create a property:
value:identifier
- Create a class:
identifier{[main-function][other-function][other-function]}
- Create an instance of a class:
!indentifier
- Acces a property of an instance:
instance%property
- Acces a method of an instance (the # is there because the method index is a number):
instance#method-index