Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create additional simpler constructors to decrease verbosity of simple control blocks #12

Closed
mkorbel1 opened this issue Sep 23, 2021 · 5 comments · Fixed by #210
Closed
Assignees
Labels
enhancement New feature or request

Comments

@mkorbel1
Copy link
Contributor

The default implementation for If, Iff, etc. take lists of Conditionals as inputs, which can be excessively verbose in cases where there is only one Conditional. Adding a special constructor (e.g. something like Iff.s) which takes a single Conditional could make simple code look cleaner.

@mkorbel1 mkorbel1 added the enhancement New feature or request label Sep 23, 2021
@quekyj
Copy link
Contributor

quekyj commented Nov 16, 2022

Hi @mkorbel1 , maybe I can try on this next.

@quekyj
Copy link
Contributor

quekyj commented Nov 24, 2022

Suggested Implementation:

If.s(Logic condition, Conditional then, [orElse])

[orElse] is optional param

Current If Implementation

If(Logic condition, {List<Conditional> then = const [], List<Conditional> orElse = const []})

@quekyj
Copy link
Contributor

quekyj commented Nov 24, 2022

counter_test.dart

Sequential.multi([
      SimpleClockGenerator(10).clk,
      reset
    ], [
      If(reset, then: [
        val < 0
      ], orElse: [
        If(en, then: [val < nextVal])
      ])
    ]);

@chykon
Copy link
Contributor

chykon commented Feb 3, 2023

Shouldn't this issue be closed after this (#210) merge?

@mkorbel1 mkorbel1 linked a pull request Feb 3, 2023 that will close this issue
@mkorbel1
Copy link
Contributor Author

mkorbel1 commented Feb 3, 2023

Yes, you're right, thank you @chykon!

@mkorbel1 mkorbel1 closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants