이 문서는 https://tiddlywiki.com/languages/ko-KR/에서 티들리위키의 정적 HTML 표현의 일부입니다

Procedures

2024년 4월 22일 오전 9:03

Introduction

New in v5.3.0 A procedure is a named snippet of text. They are typically defined with the Pragma: \procedure:

\procedure my-procedure(parameter:"Default value")
This is the procedure, and the parameter is <<parameter>>.
\end

The name wrapped in double angled brackets is a shorthand way of transcluding the snippet. Each of these procedure calls can supply a different set of parameters:

<<my-procedure>>
<<my-procedure "The parameter">>
<<my-procedure parameter:"The parameter">>

The parameters that are specified in the procedure call are made available as variables.

Tip
If a procedure has more than one parameter, it is highly encouraged to use "named parameters", as shown in the third example above and in contrast to the second example. Even if it is more to type, it will pay off in the long run.

How Procedures Work

Procedures are implemented as a special kind of variable. The only thing that distinguishes them from ordinary variables is the way that the parameters are handled.

Using Procedures