orange logo
the.language <- page (
   home | ...    language | ...    compiler | ...    framework | ...    status | ...    platforms | ...    download | ...








links:
www.eyestep.org
orange at sourceforge




hosted by:
SourceForge Logo





 

orange is a new object orient language, which tries to blend this characteristic with a strong functional approach very similar to that of scheme. it's object model, related to that of objective c, is class based (with classes for first class objects: it is class based, classes are first class objects, it supports class methods ("static methods") and class attributes. additionally the language itself provides mechanism for full introspection and genericy of types (especially collections types).

like scheme the orange language is statically scoped, and like objective c access to class or instance attributes is completly forbidden from outside an object.

the language specification is available for free as a pdf document (on as cvs sources) from sourceforge, or for convenience from here: "The orange language specification".

the language presented here understands itself as a rfc and is a draft. every comment is welcome. please use the mailinglist blue-c-language on sourceforge for discussions or contact me privatly: gck@eyestep.org.

example

here comes the standard 'hello world' only to give a short example of what orange looks like:

require "EyeStep/Orange 1.0:lang"

org.eyestep.$hello-world$ <- macro | "Hello world!".

org.eyestep.HELLO-WORLD <- class (
| display-string (STRING) <- "" |
  
  init-with-string: v(STRING) : (self) |
    super init,
    display-string <- v,
    self.

  display |
    RT out ' print: display-string "\#nl".
)

app.MAIN <- [|
  HELLO-WORLD alloc ' init-with-string: $hello-world$ ' display
]

this code example is much too large for the problem, of course, but it shows, how to use types, variable argument lists (in the display method), declaring classes, using the default language entry point, macros, etc.