diff --git a/research/SConscript b/research/SConscript index 11f58d5c9..4df559f6a 100644 --- a/research/SConscript +++ b/research/SConscript @@ -13,7 +13,7 @@ envR.Append(CPPPATH='research') # envR.Append(CCFLAGS=' -O3 ') # build additional test and administrative tools.... -experiments = [ envR.Program('try', ['try.cpp'] + support_lib) #### to try out some feature... +experiments = [ envR.Program('try', ['try.cpp'] + core) #### to try out some feature... , envR.Program('clang-static-init', ['clang-static-init-1.cpp', 'clang-static-init-2.cpp']) ] diff --git a/research/try.cpp b/research/try.cpp index ddfd21498..4c7342111 100644 --- a/research/try.cpp +++ b/research/try.cpp @@ -60,6 +60,8 @@ using lib::meta::Types; using lib::meta::NullType; using proc::control::CommandSignature; using proc::control::CommandDef; +using proc::control::Command; +using lib::time::TimeVar; using lib::time::Time; using util::stringify; using util::join; @@ -91,24 +93,24 @@ template struct Funny { static void - operate (ARGS const& ...args) + operate (ARGS ...args) { VecS strs = stringify (args...); - cout << join (strs); + cout << join (strs) < (args...); return join (strs); } static void - undo (ARGS const& ...args, string plonk) + undo (ARGS ...args, string plonk) { VecS strs = stringify (args...); - cout << "UNDO..." << plonk << "args=" << join (strs); + cout << "UNDO..." << plonk << "| args=" << join (strs) <::capture ("lalü", string("lala"), 12, 34L, 56.78) <::operate; + auto ops = Funny::operate; using FunnySIG = lib::meta::_Fun::Sig; @@ -160,6 +162,21 @@ main (int, char**) cout << capy (98.7654321987654321987654321, Time(1,2,3,4)) <::operate) + .captureUndo(Funny::capture) + .undoOperation(Funny::undo); + + cout << Command("lalü") << endl; + + Command com = Command("lalü"); + + com.bind(12.33445566778899, TimeVar(Time(4,3,2,1))); + + com(); + com.undo(); + cout << "\n.gulp.\n"; return 0;