Object inheritanceok
structure/09-inherit.mq.md
View
opening…
Bridge
文档
hello
说明 who=world
hello
说明 who=world
`m` = > `g`.hello who="world"
`m2` = > `l`.hello who="world"
可执行知识(辅助)
文档中的步骤
结构步骤(非实际执行时序)
call printcall print
Greeter.hello function
- Target
mq://public/structure%2F09-inherit/function/Greeter/hello- Signature
(who: any) → any- Effects
- pure
- Verification
- parse: passed; resolve: passed; contract: unchecked; tests: unknown; evidence: unverified(尚无来源记录)
- 制品摘要
sha256:10d9ec9ff2e13… (未检查锁定状态)- Depends on
none- Execution
- 尚无该知识的运行记录(知识预览不执行)。
Loud.hello function
- Target
mq://public/structure%2F09-inherit/function/Loud/hello- Signature
(who: any) → any- Effects
- pure
- Verification
- parse: passed; resolve: passed; contract: unchecked; tests: unknown; evidence: unverified(尚无来源记录)
- 制品摘要
sha256:5e53f1d1e076d… (未检查锁定状态)- Depends on
none- Execution
- 尚无该知识的运行记录(知识预览不执行)。
运行与结果
Hello, world!
HELLO, world!
完整源码
---
markup: occlusion
title: Object inheritance
description: "# Child = > Parent; methods walk the base chain"
---
# Greeter
## hello
+ `who`
**`msg` = "Hello, `who`!"**
*`msg`*
# Loud = > Greeter
## hello
+ `who`
**`msg` = "HELLO, `who`!"**
*`msg`*
# main
**`g` = > Greeter**
**`m` = > `g`.hello who="world"**
> print text=`m`
**`l` = > Loud**
**`m2` = > `l`.hello who="world"**
> print text=`m2`