Skip to content

Latest commit

 

History

History
99 lines (75 loc) · 971 Bytes

README.md

File metadata and controls

99 lines (75 loc) · 971 Bytes

Den Overview

A series of patterns for the Den programing language.

Variable

foo : bar
string : "hello"
float : 1.23
int : 10

Operators

+ 3 5
- 10 2
* 4 2
/ 16 2
^ 2 2 2
% 8 

Conditions

? > 10 : True
? = 10 : True
? < 10 : True

Ranges

"string".1
"string".1..2 

Comments

{ Comment Line }
{ 
  Comment Block
}

Functions

function param1 param2
  : return

Functions & Conditions

function param1 param2
  ? = ! + param1 param2 10
    : True
  : False

Classes & Methods

Numbers val1 val2
  Value1 : val1
  Value2 : val2
  add
    : + Value1 Value2
  sub
    : - Value1 Value2

test:Numbers 10 5
test.add

Loops, Foreach & While

By default, methods don't break. So these 3 patterns are obtained with the same code.

index : 0
loop
  ? = index 10 : True
  + = index 1

Extension

someClass
  methodA : True
  methodB : True

someClass.methodC : True