Skip to content

Instantly share code, notes, and snippets.

@retep998
Last active November 2, 2015 21:56
Show Gist options
  • Save retep998/cdd164c7552d01a11259 to your computer and use it in GitHub Desktop.
Save retep998/cdd164c7552d01a11259 to your computer and use it in GitHub Desktop.
Contextual overload language spec

##Identifiers## Identifiers are any valid sequence of one or more unicode characters not including whitespace or the symbols */=. Indentifiers consisting entirely of digits will often be contextually understood to represent their numerical value, although depending on context they might mean something else. Case sensitivity is contextual.

##Comments## Comments are done by using tabs and last until either the end of the line or another tab

##Statements## Statements are of the form

identifier = expression

They are separated by whitespace.

##Functions## Functions are a statement where the identifier is followed by arguments as such

functionname * arg1 * arg2 = expression

Functions are invoked like so

arg1 * arg2 * functionname

This is also how you get the function pointer to do things with it. Whether it calls the function or treats it as a function pointer is contextual based on the names of the variables.

##Primitive operations## All primitive operations are done with *. The chosen operation is contextual based on the names of the variables.

area = width * height	Performs multiplication
total_money = money_in_pocket * money_in_bank	Performs addition
speed = distance * time	Performs division
thing = myarray * index	Performs array indexing

##Order of operations## Order of operations is contextual based on the names of the variables.

##Conditionals## Conditionals are just simple functions.

blahiffalse * blahiftrue * condition * if

##Structure## There is no way to define structures. Instead you aggregate things together which you can later pull out things.

vector = x * y * aggregate
magnitude = position * x * 2 * pow * position * y * 2 * pow * 0.5 * pow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment