Skip to content
/ QED Public

A Java interpreter for QED programming language

License

Notifications You must be signed in to change notification settings

AkramIzz/QED

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QED

A Java interpreter for QED programming language

QED?

QED is an abbreviation of the Latin words "Quod Erat Demonstrandum" which loosely translated means "that which was to be demonstrated". It is usually placed at the end of a mathematical proof to indicate that the proof is complete.

Features

Closures

fun make_counter(n) {
  var count = n - 1;
  fun counter() {
    counter = counter + 1;
    return counter;
  }
  return counter;
}

var counter = make_counter(0);
print counter(); // 0
print counter(); // 1

Arrays

var arr = [1, 2, nil, "Hello"];
print arr[2]; // nil
print arr[4]; // index out of range error
arr[0] = 0;
print arr; // [0, 2, nil, "Hello"];

Classes and Inheritance

class Vehicle {
  fun init(wheels) {
    this.wheels = wheels;
  }
  
  fun start() {
    ...
  }
}

class Car > Vehicle {
  fun init() {
    super.init(4);
  }
  
  fun start() {
    super.start();
    ...
  }
}

var car = Car();
print car.wheels; // 4

About

A Java interpreter for QED programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published