Objection is a (currently unimplemented) interpreted programming language with one tenet: anything and everything is an object.
Objective C's syntax highlighting will be used for examples here, as it fits pretty well.
char
,uchar
,short
,ushort
,int
,uint
,long
,ulong
Stores an integer with varying precision.
Example:13uc
,-16s
,717
,8305ul
float
,double
Stores a floating point number with varying precision.
Example:13.5f
,1e20d
string
Stores a string of text.
Example:"Hello there!"
All strings have.format(any... value)
to allow string formatting.
Also, newlines can be inserted into strings with no difficulty.bool
Stores a 1-bit value.
Example:true
,false
vec
Stores an ordered, immutable group of values.
Example:(1, 2, 3)
list
Stores an ordered, mutable group of values.
Example:[1, 2, 3]
group
Stores an unordered, immutable group of values.
Example:|(1, 2, 3)|
set
Stores an unordered, mutable group of values.
Example:|[1, 2, 3]|
any
Abstract, can represent any type of value.
Variables of this type aren't type-checked.
annotation
The annotation for a type or function.
Example:<int>
,<float, <int, bool>>
argument
An argument specifier in a function signature.
Example:x: int
,y: function<int>
type
A class. Will touch on later.
Examples:{ public x: int = 6; }
,int
,bool
signature
The concatenation of avec<annotation>
and anargument
.
Example:(x: int)<float>
function
The concatenation of anargument
and atype
.
Example:<int>{return 5;}
callable
The concatenation of either avec<annotation>
and afunction
, or asignature
and atype
.
Example:(x: int)<int>{return x * 2;}
partial
The concatenation of acallable
and avec<any>
. Not ran yet.
Example:(x: int)<int>{return x * 2;}(5)
runner
Only the built-in value!
can have this type. Runs apartial
when concatenated with one.
Example:!((x: int)<int>{return x * 2;}(5)) == 10
Notice how this is still in the Types section.
keyword
A keyword. New ones can't be made (how would that work?)
Examples:if
,for
operator
A two-argument operator.
All operators implementconcat = (other: std::ops::assign)<operator>
to allow in-place mutation.
Example:(5 (operator)->{ // subclass of operator, will be touched on later public operate: callable<int> = (a: int, b: int)<int>{return a+b;}; } 8) == 13
null
any
- Represents the abscence of a value.!
runner
- Runs apartial
when concatenated with one.public
keyword
- Allows a value of a type to be accessed externally.+
,-
,*
,/
,%
,**
operator
- Arithmetic operators.==
,~=
,<
,>
,<=
,>=
operator
- Comparison operators.&&
,||
,^
,~
operator
- Bitwise operators.~
represents not.import
keyword
- Allows importing a file as a type.
Example:import (utils: "./utils.ob");
print
callable
- Outputs to stdout.
Example:!print("Hello, world!\n");
input
callable
- Gets a line of input from stdin.
Example:!input("Input your name: ");
_ TODO: Finish _