taskThe Nosica programming language - Tasks: task #983, Implements Signal/Slot

Show feedback again

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

task #983: Implements Signal/Slot

Submitted by:  David Jobet <djobet>
Submitted on:  Mon Oct 25 20:57:52 2004  
Should Start On: Mon Oct 25 00:00:00 2004Should be Finished on: Mon Oct 25 00:00:00 2004
Category: CompilerPriority: 1 - Later
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenEffort: 0.00

Mon Oct 25 20:57:52 2004, original submission:

When we did think of signal/slot signals, we finally gave up because we could
not find a suitable object syntax to represent this feature.

Here's my proposal : make methods in Nosica be real objects.
What this means ? Well, don't know yet where this is heading but here's the
syntax one can write :

In QT :
connect(obj1, SIGNAL(method1), obj2, SLOT(method2));

In Nosica :

Nice isn't it ?

A method is an object.
That means we must provide a way to "browse" a method.
Like in :
Method m = obj1.method1;

class Method /* extends Object */
// browsing method
public bool isSub();
public ResultType getResultType();
public string getName();
public bool isConst();
public MethodKind getKind();
public Iterator<Argument> iterateArguments();

// signal / slot / connection
public void connect(Method m);
public void disconnect(Method m);

class Argument
public bool isConst();
public TypeName getTypeName();

class ResultType extends Argument
public bool isSub();

class MethodKindEnum
public static MethodKindEnum infix = new MethodKindEnum(0);
public static MethodKindEnum postfix = new MethodKindEnum(1);
public static MethodKindEnum prefix = new MethodKindEnum(2);
public static MethodKindEnum constructor = new MethodKindEnum(3);
public static MethodKindEnum destructor = new MethodKindEnum(4);
public static MethodKindEnum property = new MethodKindEnum(5);
public static MethodKindEnum propertyArray = new MethodKindEnum(6);
public static MethodKindEnum cast = new MethodKindEnum(7);
public static MethodKindEnum method = new MethodKindEnum(8);

private word counter;
private MethodKindEnum(const word counter) { this.counter = counter; }

class TypeName
private int nbDim = 0;
private vector<TypeNameComponent> components;

class TypeNameComponent
private bool isGeneric;
private string componentName;
private Vector<TypeName> genericComponents;

Argument/ResultType/MethodKind/TypeName/... should be modeled on the same way
the symbol package is modeled in the Nosica compiler ...
You get the idea.

Don't know yet if we have to specify wether a method should be declared as a
signal/slot ... After all, all we need is to make sure signatures are the
same... Will have to read QT doc to see if there is a more fundamental reason.
Anyway, it should not be too hard to add signal/slot declaration in front of
methods ...
Perhaps should we provide other usefull methods than connect (disconnect, ...) ...

Perhaps should we provide a complete reflexive package like a Class object that
models objects and are browsable at runtime, and of course a Field object ...

Any other thought ?

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.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup