marqdo

Functions and named callsok

structure/02-function.mq.md

文档

main

说明

Use # / ## for functions. Parameters are bare - name lines under the heading.

Call with > and named args param=value:

> greet who=World

greet

说明
who=World
+ who
> print text=Hello who!
Functions
Variables
  • description text
    `#` defines functions; `>` calls; `-` lists parameter names
  • markup text
    occlusion
  • title text
    Functions and named calls
可执行知识(辅助)

文档中的步骤

结构步骤(非实际执行时序)

  1. call print
  2. call greet → mq://public/structure%2F02-function/function/main/greet

main.greet function

Target
mq://public/structure%2F02-function/function/main/greet
Signature
(who: any) → any
Effects
output.write
Verification
parse: passed; resolve: passed; contract: unchecked; tests: unknown; evidence: unverified(尚无来源记录)
制品摘要
sha256:bef88f56d472f… (未检查锁定状态)
Depends on
none
Execution
尚无该知识的运行记录(知识预览不执行)。

运行与结果

Hello World!
完整源码
---
markup: occlusion
title: Functions and named calls
description: `#` defines functions; `>` calls; `-` lists parameter names
---

# main

Use `#` / `##` for functions. Parameters are bare `- name` lines under the heading.

Call with `>` and named args `param=value`:

> greet who=World

## greet
    + `who`

> print text=Hello `who`!

Variable