digitalmars.D.announce - Cushion the state transition table library released
- SHOO (10/10) Jun 26 2019 Cushion is a library for managing state transition by state
- ag0aep6g (21/49) Jun 26 2019 You've got bad `@trusted`s.
- SHOO (6/16) Jun 27 2019 Thank you for your technical review.
- Digital Mars (3/7) Jun 27 2019 IMHO, this is unusual for D community to make review in such form. I
- aliak (4/43) Jun 27 2019 I really love that you go in to the code and find things like
- ag0aep6g (6/9) Jun 27 2019 Probably. But this isn't D.learn, and I'm getting tired of explaining
- Atila Neves (3/10) Jun 28 2019 Would you consider writing a blog post about it? I'm sure it
- ag0aep6g (5/7) Jun 29 2019 I wrote a little something up:
- Guillaume Piolat (3/13) Jun 28 2019 If you've identified guidelines for using @trusted it could be
Cushion is a library for managing state transition by state transition table design. This library parses CSV format tabular file described the design of states passed by string import and generates D language code. It can be used with string mixin. It may be useful if you are dealing with a program that changes behavior depending on the state. Thanks! DUB: https://code.dlang.org/packages/cushion GitHub: https://github.com/shoo/cushion
Jun 26 2019
On 26.06.19 16:01, SHOO wrote:GitHub: https://github.com/shoo/cushionYou've got bad ` trusted`s. Quoting from there:pragma(inline) T trustedCast(T, Arg)(Arg arg) trusted { return cast(T)arg; }No.pragma(inline) void call(Handler, Args...)(ref Handler handler, Args args) trusted {[...]handler(args);Noo.pragma(inline) void add(Handler, Func)(ref Handler handler, Func func) trusted {[...]handler ~= func;[...]handler.insert(func);[...]handler.connect(func);Nooo.pragma(inline) void remove(Handler, Func)(ref Handler handler, Func func) trusted {[...]__traits(getMember, handler, "remove")(func);[...]handler.disconnect(func);[...]handler.linearRemoveElement(func);Noooo.struct StateTransitor([...]EventContainer = SList!EventType) {[...]> EventContainer _events; [...]void consume() safe {[...]() trusted {[...]_events.removeFront();[...]}(); }Nooooo.
Jun 26 2019
On Wednesday, 26 June 2019 at 15:20:45 UTC, ag0aep6g wrote:On 26.06.19 16:01, SHOO wrote:Thank you for your technical review. You can report new issues on GitHub: https://github.com/shoo/cushion/issues Or, you may also create a pull request: https://github.com/shoo/cushion/pullsGitHub: https://github.com/shoo/cushionYou've got bad ` trusted`s. Quoting from there:pragma(inline) T trustedCast(T, Arg)(Arg arg) trusted { return cast(T)arg; }[...] Nooooo.
Jun 27 2019
27.06.2019 13:52, SHOO пишет:Thank you for your technical review. You can report new issues on GitHub: https://github.com/shoo/cushion/issues Or, you may also create a pull request: https://github.com/shoo/cushion/pullsIMHO, this is unusual for D community to make review in such form. I hope it won't repeat. Thank you for your patience.
Jun 27 2019
On Wednesday, 26 June 2019 at 15:20:45 UTC, ag0aep6g wrote:On 26.06.19 16:01, SHOO wrote:I really love that you go in to the code and find things like this, especially when it comes to abuse of trusted, but maybe a little explanation as to why would be more helpful to the OP ;)[...]You've got bad ` trusted`s. Quoting from there:[...]No.[...][...][...]Noo.[...][...][...][...][...][...][...]Nooo.[...][...][...][...][...][...][...]Noooo.[...][...][...][...]> EventContainer _events; [...][...][...][...][...][...][...][...]Nooooo.
Jun 27 2019
On 27.06.19 23:34, aliak wrote:I really love that you go in to the code and find things like this, especially when it comes to abuse of trusted, but maybe a little explanation as to why would be more helpful to the OP ;)Probably. But this isn't D.learn, and I'm getting tired of explaining trusted. I don't want to discourage anyone from writing libraries and showing them off here, but I do want to discourage people from writing trusted code.
Jun 27 2019
On Thursday, 27 June 2019 at 22:36:14 UTC, ag0aep6g wrote:On 27.06.19 23:34, aliak wrote:Would you consider writing a blog post about it? I'm sure it would be helpful to a lot of people.I really love that you go in to the code and find things like this, especially when it comes to abuse of trusted, but maybe a little explanation as to why would be more helpful to the OP ;)Probably. But this isn't D.learn, and I'm getting tired of explaining trusted.
Jun 28 2019
On 28.06.19 16:18, Atila Neves wrote:Would you consider writing a blog post about it? I'm sure it would be helpful to a lot of people.I wrote a little something up: https://gist.github.com/aG0aep6G/f267e316d1dce2763252d82c1808d53a I'm not sure if it's all that helpful, but I don't think I'm willing to invest considerably more time into improving it further.
Jun 29 2019
On Thursday, 27 June 2019 at 22:36:14 UTC, ag0aep6g wrote:On 27.06.19 23:34, aliak wrote:If you've identified guidelines for using trusted it could be really useful to put it in some text form. :)I really love that you go in to the code and find things like this, especially when it comes to abuse of trusted, but maybe a little explanation as to why would be more helpful to the OP ;)Probably. But this isn't D.learn, and I'm getting tired of explaining trusted. I don't want to discourage anyone from writing libraries and showing them off here, but I do want to discourage people from writing trusted code.
Jun 28 2019