Vous êtes sur la page 1sur 2

    The Clump Programming Language      Home   Distribution   Documents

Keywords: Object and Class separation and Dynamic typing
Domains: Language semantic, Type checking, Compiler
Language: Clump and Java

This language propose a natural evolution of the basic Object­Oriented paradigm revisiting the duality data/knowledges and  providing a  new


approach proposing both Class­Oriented and Pattern­Oriented approaches in the same language. For this purpose this language provides two
distinct layers. The first one dedicated  to  object  specification  and  representation  and  the second one  dedicated  to  knowledge  specification,
organization  and  representation.  Compared  to  language  based  on  class  and  type  separation  we  also  extract  the  internal  state  enhancing
objects representation outside  classes.  This  evolution  breaks  definitively  conventional  Object  and  Class  definitions  where  each  concept  is
strongly linked to the other one. Mainly we show that such object in fact can have knowledges depending on external considerations and was
not definitively linked to a give class but it was an instance for a given time during its life cycle.

[10/05/2010] Release v­0.3 of the Clump Language

Object

An  object  provides  a  structure  containing  a  set  of  named  values.  Compared  to  Scandinavian  object­oriented  approach  this  structure is
comparable  to  the internal  state and  nothing else;  no  behavior was  directly linked.  In addition a type  can  be  specified  based  on  disjunctive
object type definition like functional programming languages.

   object Zero {}
   
   object Succ {
      final Peano value;

      Succ(Peano value) { 
         this.value = value; 
      }
   }

Customize your PDFs pdfcrowd.com


   type Peano = Succ | Zero 

Interface

An interface provides behaviors specification giving for each method its corresponding type. This is comparable to the interface  defined in
Java for example. In addition extensions are available providing modular design approach. It's important to notice that such interfaces provide
method definitions but no variable specification.

   interface IAdder<T> {
      T add(T);
   }

Class as set of Views

Object behaviors are described and given by classes like classical Scandinavian object­oriented approach. But these behaviors are organized
by sets called views and each set is dedicated to a given object form or pattern i.e. its type. Compared to classical approach instead of providing
two classes ­ one per object form ­ only one class with two different views can be proposed. Indeed the old class design still valid based on
behaviors separation for each object form.

   class peano(Peano) implements IAdder<Peano> {
      case Zero add(p) { 
         return p; 
      }   
      case Succ add(p) { 
         return new Succ(peano(this.value).add(p)); 
      }
   }

    Last modified: Mon Oct 11 23:39:30 CEST 2010

Customize your PDFs pdfcrowd.com

Vous aimerez peut-être aussi