Re: [PATCH 11/22] sequencer: get rid of the subcommand field
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 1, 2016, 07:55 UTC
- Message-ID
- <alpine.DEB.2.20.1609010953080.129229@virtualbox>
- In-Reply-To
- <2ba846cc-0e0f-fc7a-27d1-3b8ad66ea72b@gmail.com>
Hi Kuba,
On Wed, 31 Aug 2016, Jakub Narębski wrote:
Show 8 quoted lines
> W dniu 29.08.2016 o 10:05, Johannes Schindelin pisze: > > > While at it, ensure that the subcommands return an error code so that > > they do not have to die() all over the place (bad practice for library > > functions...). > > This perhaps should be moved to a separate patch, but I guess > there is a reason behind "while at it".
Yes. It seemed like the logical thing to do: I already introduce a new function, why should I shlep over a paradigm I do not want in the end?
> Also subcommand functions no longer are local to sequencer.c
They never were. All you had to do was to set a field and run the global function.
The real problem there was that the different local functions needed different parameters, and the round-about way to set those parameters as fields in a struct and then call a global function with that struct just makes it impossible to have compile-time safety.
Ciao, Dscho