From 13df8fc2248bd6b10bfa421061ca84d37b4c4fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com> Date: Mon, 30 May 2022 19:18:31 +0200 Subject: [PATCH] Discuss rapidly the pure function-like behavior of pugs functions --- doc/userdoc.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/userdoc.org b/doc/userdoc.org index 203404c7c..24bd03f3a 100644 --- a/doc/userdoc.org +++ b/doc/userdoc.org @@ -2078,6 +2078,19 @@ or if ~(y1,...,ym)~ has already been defined in ~Y1*...*Ym~ *** Pure functions +In the ~pugs~ language, functions are *pure functions* in the sense that +arguments given to the function are *never* modified by the +functions. They act as operators. + +#+BEGIN_note +Actually these functions are not strictly /pure functions/ in the +computer science context. The reason for that is that they can +eventually have side effects. A good example for that, is that it is +possible to modify the random seed used by the code the code. In that +case, the modified value is not a variable of the language itself but +the internal random seed itself. +#+END_note + *** TODO Implicit type conversion for parameters and returned values *** TODO User-defined functions -- GitLab