Object ancestor := method (
prototype := self proto
if (prototype != Obejct,
writeln ("Slots of ",
prototype type,
"\n------------------"
)
prototype slotNames foreach (slotName,
writeln (slotName)
)
writeln prototype ancestors
)
)
 unless := method (
(
call sender doMessage (
call message argAt(0)
)
)
ifFalse (
call sender doMessage (
call message argAt(1)
)
)
ifTrue (
call sender doMessage (
call message argAt(2)
)
)
)

 Animals.io

    Object ancestors := method (
prototype := self proto
if (prototype != Object,
writeln ("Slots of ",
prototype type,
"\n----------------"
)
prototype slotNames foreach (
slotName,
writeln (sloteName)
)
writeln prototype ancestors
)
) Animal := Object clone
Animal speak := method (
"ambiguous animal noise" println
)
Duck := Animal clone
Duck speak := method (
"quack" println
)
Duck walk := method (
"waddle" println
)
disco := Duck clone
disco ancestors

 

Io_Language的更多相关文章

随机推荐

  1. freshStartTail 第一次启动时 抛弃旧的日志

    freshStartTail [on/off] (requires v8.18.0+) Default: off This is used to tell rsyslog to seek to the ...

  2. Eclipse开发Java EE应用

    设置Web服务器 添加Web服务器 以上两步可以直接由下面这步完成: or 创建Web工程 建立JSP文件供测试 发布Java Web工程 方法1:在下方Server中添加 方法2:右击左边项目导航树 ...

  3. 【转】foxmail突然打不开了,双击没反应,怎么回事呀

    原文网址:http://tieba.baidu.com/p/3492526384 解决方法如下:1.进入foxmail安装目录(默认在D盘Program Files下层,右击foxmail这个文件夹, ...

  4. 【转】Java 内存模型及GC原理

    一个优秀Java程序员,必须了解Java内存模型.GC工作原理,以及如何优化GC的性能.与GC进行有限的交互,有一些应用程序对性能要求较高,例如嵌入式系统.实时系统等,只有全面提升内存的管理效率,才能 ...

  5. GML、SVG、VML的比较

    转自:http://www.cnblogs.com/3echo/archive/2009/02/19/1394399.html GML.SVG和VML都是基于XML的可用来描述矢量图形的标记语言,都是 ...

  6. FZU2235 国王的出游 水题

    因为只有1e5个点,所以直接离散化bfs就好 #include <cstdio> #include <cstring> #include <queue> #incl ...

  7. powershell学习

    PowerShell 调试器 在开始运行处,输入powershell ISE回车即可 PowerShell 与操作系统版本 powershell在windows server 2008上自带,但最好在 ...

  8. linux find用法总结

    前言:我们为什么要学会使用find命令? 转自:http://blog.chinaunix.net/uid-24648486-id-2998767.html 每一种操作系统都有成千上万的文件组成,对于 ...

  9. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep解决方法

    14/03/26 23:10:04 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:10020. Already tried ...

  10. LeetCode:Restore IP Address

    93. Restore IP Addresses Given a string containing only digits, restore it by returning all possible ...