OTcl
OTcl 也就是""Object Tcl"",是麻省理工学院的David Wetherall在Tcl的基础上做了面向对象的封装后所延伸出来的脚本语言。[1]它通常被用于Unix环境下运行的ns中。后来扩展成XOTcl。
语法介绍
在OTcl中,采用关键字instproc来定义一个成员函数,成员函数的定义和参数的定义与Tcl中相同,只需要在前面指定类名表示这个成员函数属于哪一个类。
// Sample code in OTcl Class HelloWorld HelloWorld instproc hello {} { puts "Hello world" } set helloworld [new HelloWorld] //to run $helloworld hello
参考文献
- . [2013-01-05]. (原始内容存档于2013-02-02).
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.