summaryrefslogtreecommitdiff
path: root/web/funnelAC/tests/ex07.fw
blob: 0ac37e18994d967387a2bfaa1f046c83440a7d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
EX07: This example demonstrates the use of macro parameters.

@O@<ex07.out@>==@{@<While user code@>@+@}

@$@<While loop@>@(@3@)@M==@{@-
@1
while (@2)
  {
   @3
  }
@}

@$@<While user code@>==@{

@! First form of actual parameters without whitespace and double quotes.
@<While loop@>@(x=1;@,x<=10@,printf("X=%u\n",x);@)

@! Second form of actual parameters. The double quotes allow non-active
@! whitespace that helps to lay out the actual parameters neatly.
@! This call is functionally identical to the one above.
@<While loop@>@(
   @"x:=1;@" @,
   @"x<=10@" @,
   @"printf("X=%u\n",x);@" @)

@! The two forms can be mixed in a single call.
@<While loop@>@(x=1;@,x<=10@,
              @"printf("X=%u\n",x);@" @)

@}