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. 【HDOJ】1253 胜利大逃亡

    经典的BFS,需要注意的是当前时间超过最小时间,输出-1.同时,队列为空时还未返回,证明并未找到终点(可能终点为墙).此时也应该输出-1,这个部分容易wa. #include <cstdio&g ...

  2. ununtu卸载软件

    sudo apt-get remove vim

  3. Mac 上Dock中添加“最近打开过的项目”(Recent Applications)

    有一个特别有用的Stack,“最近打开过的项目”,建立方法如下: 1. 打开Terminal,输入以下命令 defaults write com.apple.dock persistent-other ...

  4. C#使用Word中的内置对话框实例

    本文实例讲述了C#使用Word中的内置对话框的方法,分享给大家供大家参考.具体实现方法如下: 使用 Microsoft Office Word 时,有时需要显示用户输入对话框.虽然可以创建自己的对话框 ...

  5. Asm Shader Reference --- Shader Model 2.0 part

    ps部分 ps_2_0 概览   Instruction Set                                   Name Description Instruction slot ...

  6. kafka的安装和使用

    简单说kafka是一个高吞吐的分部式消息系统,并且提供了持久化. kafka的架构 • producer:消息生存者• consumer:消息消费者• broker:kafka集群的server,负责 ...

  7. Laravel教程:laravel 4安装及入门

    一.安装Composer首先你需要安装Composer,Composer是PHP依赖管理工具,Laravel框架就是使用 Composer 执行安装和依赖管理. 注:(1)若安装Composer出错, ...

  8. DATASNAP复杂中间件的一些处理方法

    1.中间件需要连接SQL SERVER\ORACLE\MYSQL多种数据库,怎么办? [解决]:可以搞多种数据模块池对应多种数据库,一种数据模块池对应一种数据库 2.中间件业务对象多,在一个单元里面定 ...

  9. FFT(快速傅立叶算法 for java)

    package com.test.test2; public class FFT {     public static final int FFT_N_LOG = 10; // FFT_N_LOG ...

  10. [三]SpringMvc学习-封装、乱码问题、重定向、转发

    1.对象属性自动封装 前台input 用对象的属性名,后台自动会封装为对象,类似struts 2.解决post乱码问题 在web.xml中配置过滤器 <filter> <filter ...