From b317b5d4532dcceee5bc6e6176c1e1ed0e3ebb4c Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Thu, 6 Sep 2018 07:34:02 +0200 Subject: [PATCH] =?UTF-8?q?-=20test=C3=A9=20la=20possibilit=C3=A9=20de=20m?= =?UTF-8?q?ettre=20une=20fonction=20dans=20une=20variable=20et=20une=20fon?= =?UTF-8?q?ction=20d'une=20fonction.=20Super=20pratique=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tests/test_table_func.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Tests/test_table_func.lua diff --git a/Tests/test_table_func.lua b/Tests/test_table_func.lua new file mode 100644 index 0000000..f100fa3 --- /dev/null +++ b/Tests/test_table_func.lua @@ -0,0 +1,21 @@ +-- Tests de fonctions 'redirigées' dans une variable +-- faut voir encore ceci: +-- https://stackoverflow.com/questions/1791234/lua-call-function-from-a-string-with-function-name + +print("\n test_table_func.lua zf180830.1224 \n") + + +function toto() + print("toto") +end + +function tutu(f) + f() +end + +print("fonction dans une fonction") +tutu(toto) + +print("fonction dans une variable") +titi=toto +titi()