Ked

To our knowledge, Ked is first scripting language to emerge from The People's Republic of Cork.
Below is an account of what we know so far about the mysterious Corkonian language.
Any suggested updates or contributions are encouraged. Fork me on GitHub

Variables

Setting

remember €x = 1 like

Use remember to initialize local variables. All variable names are prepended with the Euro symbol (), also this may be subject to change.

Also, notice the line ends with like. This is the ked statement terminator, it is not optional.

Unsetting

forget €x like

Determining if a variable is set

jaKnow(€x)

Returns a Boolean.

Booleans

gospel and bull are the equivalent of true and false in other languages.

Other notable differences in types

  • nattin = null
  • number = int, float, etc
  • list = array
  • thing = object

Importing

To include one ked file inside another use the hereLa command;

hereLa 'feen.ked' like

cmereToMeWilla does the same thing, but it will also force a fatal error if the inclusion fails;

cmereToMeWilla 'boeur.ked' like

Printing

saysI 'Alright boy, calm down will ya' like

This will send the string to standard output, known in ked as The Echo.

Conditional statements

eh( jaKnow( €x ) ){
	remember €z = 1 like
}
orEh( jaKnow( €y ) ){
	remember €z = 2 like
}
orEvenJust{
	remember €z = 0 like
}
				

Notable differences in operators

  • not = negation. ! is also a usable alias.
  • an = &&, AND.

  • plus = addition.

  • awayFrom = substraction.
    Example:

    remember €x = 4 awayFrom 20 like //result: 16
  • times = multiplication.
  • into = division.
    Example:

    remember €x = 4 into 20 like //result: 5
  • is = comparison.
  • isTheHeadOff = strict comparison. Alias: isTheAbsoluteHeadOff.
  • em = concatention.
    Example:

    remember €secret = 'You know' em 'your wan' like

Object-orienatation

It is understood that Ked has object-orientated capabilities, although very little is known so far.

Self-referencing

To reference a method of the current thing (i.e. object) you would do the following;

youKnowYourself.doSomethin() like

For a static method, you would call it like this:

youKnowYourself::doSomethin() like

Rebels

A Rebel is the ked equivalent of an exception.

Releasing Rebels

A.k.a throwing exceptions

Release new Rebel("I'm gonna wreck the gaff") like

Catching Rebels

The following is how to write a try - catch - finally in ked:

giveItALash{

}
jaHearYourMan( Rebel €r ){

}
atTheEndOfTheDay{

}

Sessions

Starting the session

session::start() like

Regenerate the session ID

session::topUp() like

Destroying the session

session::wreckTheGaff() like

Loops

The ked equivalent of a while loop is denoted as follows;

eraGoOnSure( €x is not nattin an €y is 2 ){

}

Break

ahStop like

Continue

ahGoOn like

Other useful functions

  • holdOn(3) like = sleep(3);
  • iWillYa() like = No-operation. Alias: yaTwoMinutesThereNow() like
  • stopTheLights() like = exit;