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. mysql联合索引

    命名规则:表名_字段名1.需要加索引的字段,要在where条件中2.数据量少的字段不需要加索引3.如果where条件中是OR关系,加索引不起作用4.符合最左原则 https://segmentfaul ...

  2. 用PersonalRank实现基于图的推荐算法

    今天我们讲一个下怎么使用随机游走算法PersonalRank实现基于图的推荐. 在推荐系统中,用户行为数据可以表示成图的形式,具体来说是二部图.用户的行为数据集由一个个(u,i)二元组组成,表示为用户 ...

  3. apache配置虚拟主机的三种方式

    Apache 配置虚拟主机三种方式   一.基于IP 1. 假设服务器有个IP地址为192.168.1.10,使用ifconfig在同一个网络接口eth0上绑定3个IP: [root@localhos ...

  4. 如何监听非本地IP

    做HA的时候,如果每个机器上同时需要监听多个IP的同一个端口.那么肯定是需要写死监听的IP和端口.比如在haproxy里面: frontend free bind default_backend te ...

  5. c#打印机设置,取得打印机列表及相应打印机的所有纸张格式

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  6. [liu yanling]测试方法

    1.定义 是把所有可能的输入数据,即程序的输入域划分成若干部分(子集),然后从每一个子集中选取少数具有代表性的数据作为测试用例.该方法是一种重要的,常用的黑盒测试用例设计方法. 2.划分等价类 等价类 ...

  7. 016专家视图测试脚本开发_utility对象

    utility对象(1)这个例子是:Extendtest使用Extend对象加载DLL,我们可以使用它来丰富windows api函数,能够编写更为强大和灵活的测试代码 实例代码: '声明FindWi ...

  8. 解决:javah 无法访问引用Android对象的问题

    无法访问android.view.View 是没有引入android.jar包 javah的参数中 有一个-bootclasspath参数 让他指向android.jar包 例如 javah -jni ...

  9. BI 多维立方体CUBE

    在Bi领域,cube是一个非常重要的概念,是多维立方体的简称,主要是用于支持联机分析应用(OLAP),为企业决策提供支持.Cube就像一个坐标系,每一个Dimension代表一个坐标系,要想得到一个一 ...

  10. node系列3

    网络操作 通过NodeJS,除了可以编写一些服务端程序来协助前端开发和测试外,还能够学习一些HTTP协议与Socket协议的相关知识 开门红 使用NodeJS内置的http模块简单实现一个HTTP服务 ...