On March 22, 2018 1:56 AM, Jérémy Zurcher <jer...@asynk.ch> wrote: > just trying to follow here and maybe clarify a bit. > > Of course everybody here knows about the conventions : > > - 0 is the success return code > - anything else is an (hopefully documented) error > > we all know about logical shell chaining : > > cmd1 && cmd2 && cmd3 || cmd4 > > but what I think I understood here is that promises chaining should be a > different construction where the chaining is not dependent on the return > code > (success/failure) of any of the actions. > > { action 1 } then { action 2 } then { action 3 } > > it's a 'then' meaning 'after that', not an '&&' that means 'on action > success' > so with v beeing the value of the promise, you do > > { action 1 } then { if (v!=0) return action21 else return action22 } then > { if (v==0) action 3 } > > and with handy helpers (operator logic) like > > bypassOnFailure(if (v!=0) return v) > bypassOnSuccess(if (v==0) return v) > > you can do > > { action1 } then { bypassOnFailure(); action2 } then { bypassOnSuccess(); > action3 } then { byPassOnFailure; action4 } > > the chaining fails on "System errors" -> Exception on some languages > the logic is implemented in the futur > > hope I'm not in outer space.
Exactly, you got it ! Thanks, Cedric ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel