Procedures.


%%% Anonymous procedure:
declare
Z
{(proc {$ X} Z = X + 1 end) 2}
{Browse Z}

%%% Assigning an anonymous procedure value to a variable:
declare
Z1
Add1 = proc {$ X} Z1 = X + 1 end

{Browse Add1}

{Add1 5}

{Browse Z1}

%%% Shortcut for creating a procedure value and storing it in a variable:
declare
Z2
proc {AddOne X} Z2 = X + 1 end

{Browse AddOne}

{AddOne 3}

{Browse Z2}

CSci 4651 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.