Skip to content

rasmuserik/lightscript-old

Repository files navigation

% LightScript Documentation % Rasmus Jensen @ lightscript.net % 2010

logo Introduction

LightScript is a scripting language for rapid application development for mobile phones.

Features include:

  • Runs on very low end mobile phone, requires only CLDC/1.0
  • JavaScript/EcmaScript-like semantics and syntax
  • Closures and first class functions
  • Objects with prototypical inheritance
  • Small size ( < 30KB code footprint) and fast execution
  • Exceptions, object literals
  • Good integration with Java

Library Reference

Standard Library

(to be more in concordance with standard soon. Non-EcmaScript-functions may change api before in next version)

  • Object.create
  • print(text)
  • clone(Object)
  • parseint(string, base)
  • global
    • .__getter__(key)
    • .__setter__(key, val)
  • All types
    • .toString()
  • java.util.Stack type
    • [elem1, elem2, ...]
    • Array()
    • .__getter__(key)
    • .__setter__(key, val)
    • .__iter__()
    • .push(val)
    • .pop()
    • .join([seperator])
    • .slice(start[, end])
    • .concat(...)
    • Array.concat(...)
    • .sort([compare function])
    • .toTuple()
  • java.util.Hashtable type
    • { key: val, key:val, ... }
    • Object()
    • .hasOwnProperty(x)
    • .__getter__(key)
    • .__setter__(key, val)
    • .__iterator__
  • java.lang.String type
    • "..."
    • '...'
    • String()
    • .__getter__(key)
    • .toInt()
    • .slice(start[, end])
    • .charCodeAt(pos)
    • .concat
    • String.fromCharCode(code)
  • java.lang.Object[] type
    • Tuple(...)
    • .sort([compare function[, start[, end]]])
    • .toArray()
  • java.lang.Integer type
    • 123...
    • .toInt()

Midp1 library (api not stabilised)

  • Menu()
    • .addItem(text[, callback])
    • .show()
  • TextBox(prompt[, default text], callback)
  • Storage.set(key, value)
  • Storage.get(key)

Language Reference

Data types

Builtin operations

Incompatibilities with JavaScript

Embedding LightScript in Java

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors