Name:

procedure defines and assigns a Sollya procedure

Usage:

procedure identifier(formal parameter1, formal parameter2,..., formal parameter n) { procedure body } : void -> void procedure identifier(formal parameter1, formal parameter2,..., formal parameter n) { procedure body return expression; } : void -> void procedure identifier(formal list parameter = ...) { procedure body } : void -> void procedure identifier(formal list parameter = ...) { procedure body return expression; } : void -> void

Parameters:

Description:

Example 1:

   > procedure succ(n) { return n + 1; };
   > succ(5);
   6
   > 3 + succ(0);
   4
   > succ;
   proc(n)
   {
   nop;
   return (n) + (1);
   }

Example 2:

   > procedure myprint(L = ...) { var i; for i in L do i; };
   > myprint("Lyon","Nancy","Beaverton","Coye-la-Foret","Amberg","Nizhny Novgorod","Cluj-Napoca");
   Lyon
   Nancy
   Beaverton
   Coye-la-Foret
   Amberg
   Nizhny Novgorod
   Cluj-Napoca
See also: proc, var, bind
Go back to the list of commands