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

Import Functionality [Feature Request] #62

Open
gachteme opened this issue Sep 4, 2019 · 0 comments
Open

Import Functionality [Feature Request] #62

gachteme opened this issue Sep 4, 2019 · 0 comments

Comments

@gachteme
Copy link

gachteme commented Sep 4, 2019

Breakout from #18 to better discuss and judge interest.

Often it is useful to have two states that are very similar, with a few different expressions. Since Continue and state transitions are disallowed due to possible infinite loop issues, a way of reducing development time and redundant SLOC would be to allow a state to import another state which would be evaluated as a setup time macro.

E.g:

Start
  \<some expressions\>
  $$IMPORT ToImportState
  \<some expressions\>

ToImportState
  \<some expressions\>
  ^\S -> Start

Questions:

  1. is there interest in this feature?
  2. is there interest in a separate import feature that does not allow the imported statements to initiate a state transition?
  3. What might the syntax look like? Currently the $$IMPORT is a placeholder.

Potential issues:

  1. Cyclical dependencies. This would be solved by not importing anything which has already been imported into a state. Another option would be only to allow immediate imports.
  2. Debug output statements would become slightly more complex. A current suggestion is to provide a back trace like: line: 10.102.50 where line 50 is the error, but was imported by line 102, which was in turn imported from line 10, which is your current state.
  3. This would likely add complexity to the visual debugger HTML-Based Visual Debugger  #48 .
  4. Unless using only immediate imports as a simple copy-paste macro, or forgoing a reasonable debug output, this feature would add a decent amount of complexity to multiple parts of the code.

Personally, when I was writing/editing/maintaining templates this feature probably would have saved me a few hours a month in development time. Which is to say it would have been nice but clearly wasn't a deal-breaker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants