Below example is from wiki http://www.ecere.com/wiki/index.php?title=Utilities
Linked List Example
Code: Select all
import "ecere"
class MyItem : struct
{
MyItem prev, next;
int value;
}
void Test()
{
MyItem i;
List list { };
list.Add(MyItem { value = 5 });
for(i = list.first; i; i = i.next)
printf("%d\n", i.value);
list.Free(null);
}
class MyApp:Application
{
void Main()
{
Test();
system("pause");
}
}
Compiling...
bug01.ec
bug01.ec:14:13: warning: incompatible expression MyItem { value = 5 } (MyItem); expected LLT
bug01.ec:15:12: warning: incompatible expression list.first (ecere::com::Link); expected MyItem
bug01.c
bug01.ec:17: error: too many arguments to function '(void (*)(struct __ecereNameSpace__ecere__com__Instance *))*(list->_vTbl + (unsigned int)((unsigned int)__ecereVMethodID___ecereNameSpace__ecere__com__Container_Free * 4u))'
bug01.exe (Debug) - 1 error, 2 warnings
What's wrong here?Is the example wrong or there is some bug in the ec language?If the example is wrong,how to fix it then?
If this is a ec issue,I think maybe the most important is to fix the bugs in the language before any new features supposed to add in in the furture.
Thanks and best regards,
Sam