View Issue Details

IDProjectCategoryView StatusLast Update
0000586Ecere SDKidepublic2016-04-19 05:19
Reportersacrebleu Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Target Version0.46 eC II 
Summary0000586: Programmable function pointers on methods and as variables
Description<sacrebleu> Oh yes I forgot, Esphynx, programmable virtual function pointers as members ... the ability to do the following :
<sacrebleu> define a function pointer, using special keyword "programmable" in the following way -> class Something { programmable void Somefunc( default parameters ) { default functionality } };
<sacrebleu> permits the user to then set Something.Somefunc = { some code } .. method 1
<sacrebleu> method 2 set Something.Somefunc = &functionname;
<sacrebleu> method 3 create a set
<sacrebleu> class Something { programmable void Somefunc() { } void Someotherfunc() {} void Thirdfunc() { this.Somefunc=Someotherfunc; }
<sacrebleu> and there is a method 4 which is essentially the same thing as void Method( a ) {} void Method ( a , b ) {}
<sacrebleu> so maybe not offering the fourth method..
<sacrebleu> makes more sense
Additional InformationAs variable:

void somefunc() { /* ... */ }

function void Somefunction() = &somefunc();

// implies 'enum'
class SomeClass {
 programmable /*enum*/ states { on,off } as
  void method() {
    some default functionality, or mapped to perhaps even this.method=on;
    when !mapped, default value (when appropriate) for method=
    null/empty/optimize out
  } and
  void on() {
  } and
  void off() {
  } when LightSwitch( states state ) {
  switch ( state ) {
   case on: method=someothermethod; break;
   case off: method=yetanothermetjhod; break;
   default: method=this.method(); break;
  }
 }
}


"off" referring to someothermethod can be invoked as:
 someclass.LightSwitch(off); someclass.method();
or someclass.method[off];
TagsNo tags attached.

Relationships

related to 0001028 new Closure support 

Activities

sacrebleu

2011-01-06 04:51

reporter   ~0000432

CORRECTION:

As variable:

void somefunc() { /* ... */ }

function void Somefunction() = &somefunc();

// implies 'enum'
class SomeClass {
 programmable /*enum*/ states { on,off } as
  void method() {
    some default functionality, or mapped to perhaps even this.method=on;
    when !mapped, default value (when appropriate) for method=
    null/empty/optimize out
  } and
  void on() {
  } and
  void off() {
  } when LightSwitch( states state ) {
  switch ( state ) {
   case on: method=on; break;
   case off: method=off; break;
   default: method=this.method(); break;
  }
 }
}


"off" referring to someothermethod can be invoked as:
 someclass.LightSwitch(off); someclass.method();
or someclass.method[off];

can still call directly someclass.method.off();

sacrebleu

2011-01-06 04:53

reporter   ~0000433

needs semi (;)

sacrebleu

2011-01-06 05:00

reporter   ~0000434

someclass.method[off](some parameters); for functions written in this form.

Issue History

Date Modified Username Field Change
2011-01-06 04:50 sacrebleu New Issue
2011-01-06 04:51 sacrebleu Note Added: 0000432
2011-01-06 04:53 sacrebleu Note Added: 0000433
2011-01-06 05:00 sacrebleu Note Added: 0000434
2012-03-08 16:52 redj Target Version => 0.45 Ginkakuji
2012-03-29 07:52 redj Category => ide
2012-03-29 07:52 redj Project @3@ => Ecere SDK
2014-05-19 20:16 jerome Relationship added related to 0001028
2014-07-11 18:37 jerome Target Version 0.45 Ginkakuji => 0.46.1
2016-04-19 05:19 jerome Target Version 0.46.1 => 0.46 eC II