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

circular dependencies not allowed #29

Open
hakunin opened this issue Mar 29, 2011 · 1 comment
Open

circular dependencies not allowed #29

hakunin opened this issue Mar 29, 2011 · 1 comment

Comments

@hakunin
Copy link
Contributor

hakunin commented Mar 29, 2011

Dubious should support circular dependencies between files.

Example of circular dependency I'd like to have:

class MetricsSuite
  def app(app:Webapp)
    @app = app
    self
  end

  def self.for_app(app:Webapp)
    new.app(app)
  end
end

class Webapp < Model
  def self.register(title:String)
    app = new.title(title).on_register
    app.save
    app
  end

  def on_register
    MetricsSuite.for_app(self).install
    self
  end
end
@baroquebobcat
Copy link
Member

If we changed the compilation step to just give all the files to the Mirah compiler at once, this should work because it will figure out the dependencies at compile time. The problem currently is that I think we don't do that.

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

No branches or pull requests

2 participants