What does a return statement mean within a module's body, but not within ModuleApply, ModuleLoad, or ModuleUnload procedures?

Is the disappearance of the return line, and the u:=3 line that follows it, some sort of automatic simplification? I'm not even sure what such a return statement is supposed to mean, in a module's body but not in ModuleApply et al.

> module() local u; u:=2; return; u:=3; end:
> convert(%,string);
"module () local u; u := 2; end module"

When I mention automatic simplification here I mean things like the disappearance of the if..then..fi for the following procedure creation. I also wonder where in the help-pages that simplification is documented.

> proc() local u; if false then if true then u; fi; fi; u:=2; end;
proc() local u; u := 2 end proc

And I wonder why the dead code after the return isn't removed for a proc in the manner that it appears to be removed for a module.

> proc() local u; u:=2; return; u:=3; end;
proc() local u; u := 2; return ; u := 3 end proc

Ok. So I tried a few more module examples.

> module() local u,z; u:=2; if z<>9 then return; fi; u:=3; end:
> convert(%,string);
"module () local u, z; u := 2; end module"

> module() local u; u:=2; u:=3; end:
> convert(%,string);
"module () local u; u := 3; end module"

One might imagine that this all indicates that quite a bit more simplification is taking place for module creation. I suppose that the first line of ?module is supposed to explain it.

"A module is a first-class Maple expression that is created as a result of evaluating a ``module definition''."

So, maple "evaluates" the definition. Strong stuff.

acer

Please Wait...