taskThe Nosica programming language - Tasks: task #980, Implements proxies keywords

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #980: Implements proxies keywords

Submitted by:  David Jobet <djobet>
Submitted on:  Mon 25 Oct 2004 08:53:29 PM UTC  
 
Should Start On: Mon 25 Oct 2004 12:00:00 AM UTCShould be Finished on: Mon 25 Oct 2004 12:00:00 AM UTC
Category: CompilerPriority: 1 - Later
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenEffort: 0.00

Mon 25 Oct 2004 08:53:29 PM UTC, original submission:

Proposed syntax to allow automatic delegation in the field section of a class :
TypeName field proxies (TypeName)+;

Rational : a delegate has nothing to do with class/interface inheritance.
==> It has nothing to do in the class definition line (class A implements I1
delegates ...)
Rational : a delegate is really an association
==> it has to appear as a field declaration.
rational : a delegate must have a name so that it can be used to overload a
method or do other stuff
==> a delegate is really a field and has a TypeName and a field name

Example :
---
public interface I1 {
sub f();
}

public interface I2 {
sub g();
}

public Impl implements I1, I2 {
public sub f() { /* implementation follows */ }
public sub g() { /* implementation follows */ }
}

public interface I3 {
sub h();
}

public A implements I1, I2, I3 {
private Impl impl proxies I1, I2; // the delegation

/* equivalent to
sub f() { impl.f(); }
sub g() { impl.g(); }
*/
public sub h() { /* implementation follows */ }
}
---

The delegation field 'impl' forward the implementation for all methods defined
in I1 and I2.

It is always possible to overload a method implemented by 'impl'.

Example :
---
public A implements I1, I2, I3 {
private Impl impl proxies I1, I2; // the delegation

/* method f() is automatically implemented by impl */
public sub g() { /* do stuff / / can call impl.g() */ }
public sub h() { /* impl follows */ }
}

David Jobet <djobet>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by djobet (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup