Skip to content

circular dependencies not allowed #29

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

2 participants

@hakunin
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
The Mirah Community 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
Something went wrong with that request. Please try again.