1

GAP differentiates a procedure call from a function: functions return a value whereas procedure calls produce an effect. Writing a function is fine, but what's the syntax for writing a procedure call in GAP?

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35

1 Answers1

1

I believe that the syntax is the same. You just have to omit the return statement, if there are no variables, that should be modified in the procedure. But if you have to return some values, I suggest that you should return them as list (i.e. [a, b,c,...]. ).

  • 1
    Indeed, as one of the links in the OP says "A procedure call is done exactly like a function call. The distinction between functions and procedures is only for the sake of the discussion, GAP does not distinguish between them". Also you don't have to _omit_ the `return` statement - `return;` will stop execution, but will return nothing. – Olexandr Konovalov Jun 30 '20 at 16:12