我有兴趣学习一种语言,它在内部处理对象作为哈希表(如JavaScript),但可以用强类型包装它们,以便在设计时提供代码完成/智能感知的好处.以下是我希望这种梦想语言能够发挥作用的方式:
public class Lion
{
public void Roar() { Console.WriteLine("Aaarrgghh");}
}
public static Main(string[] args)
{
object myCat = new object(); // just plain object, no type!
// adding a Roar() method to the myCat instance
myCat.Roar += delegate() {Console.WriteLine("Miauew");}
// At this point myCat should qualify to be a Lion.
// So we should be able to successfully duck-type-cast
// her to a lion
Lion myLion = myCat as Lion;
// now the myLion reference is strongly typed,
// …Run Code Online (Sandbox Code Playgroud) 我最近因为PyDev在代码完成wxPython代码时没有关于类和函数的信息而感到恼火.
当C/C++和Python的代码完成时,任何人都可以告诉我FOSS IDE或扩展提供代码信息(函数参数,返回等).
我是CodeLite,Eclipse CDT和CodeBlocks的粉丝,按顺序排列C/C++(非FOSS除外)和PyScripter,PyDev for Python.