end -- close a block statement
Introductionend is a keyword which, depending on the context, is
parsed as one of the following keywords:
Related
Functionsend_case, end_for, end_if, end_proc, end_repeat, end_while
Example
1Each of the keywords proc, case, if, for, repeat, and while starts some block construct in
the MuPAD language. Each block can be closed with
end or with the corresponding special keyword end_proc, end_case etc.:
>> f :=
proc(a, b)
local i;
begin
for i from a to b do
if isprime(i) then
print(Unquoted, expr2text(i)." is a prime")
end
end
end:
>> f(20, 30):
23 is a prime
29 is a prime
The parser translates end to the
appropriate keyword matching the type of the block:
>> expose(f)
proc(a, b)
name f;
local i;
begin
for i from a to b do
if isprime(i) then
print(Unquoted, expr2text(i)." is a prime")
end_if
end_for
end_proc
>> delete f:
end is a new keyword.