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,8305ulfloat,double
Stores a floating point number with varying precision.
Example:13.5f,1e20dstring
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,falsevec
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,boolsignature
The concatenation of avec<annotation>and anargument.
Example:(x: int)<float>functionThe concatenation of anargumentand atype.
Example:<int>{return 5;}callableThe concatenation of either avec<annotation>and afunction, or asignatureand atype.
Example:(x: int)<int>{return x * 2;}partialThe concatenation of acallableand avec<any>. Not ran yet.
Example:(x: int)<int>{return x * 2;}(5)runnerOnly the built-in value!can have this type. Runs apartialwhen concatenated with one.
Example:!((x: int)<int>{return x * 2;}(5)) == 10
Notice how this is still in the Types section.
keywordA keyword. New ones can't be made (how would that work?)
Examples:if,foroperatorA 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 apartialwhen 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 _