: (or/c string? symbol? url? path? (generic-instance/c gen:equal+hash))
(recursive-contract (-> clear/c (instanceof/c (subclass?/c unlike-compiler%)) unlike-asset/c))
In this collection, unlike assets may depend on one another. This is the status quo for any multimedia project such as video compositions, web pages, and video games. All dependencies must be fulfilled before advancing any asset, so no circular dependencies are allowed.
Dependencies are referenced by freeform unclear strings that describe other assets, like a URI or a relative path string. An instance of unlike-compiler% must clarify these strings and delegate work to procedures that can fulfill the assets under the clear/c names. An unlike-compiler% instance can also mark changes on an asset’s value and control how that change ripples to dependencies.
unclear : unclear/c
Override this method to deterministically map an unclear string to a clear name for an asset. By default, clarify is the identity function.
Once assets have clear names we need to decide what to do with them by delegating work out to appropriate procedures.Override this abstract method to deterministically return the first value to represent an asset of name clear.If delegate returns an advance/c procedure, that procedure must accept the same clear name and the instance of the compiler as arguments, and either return the next advance/c procedure to pass on responsibility, or a terminal value that isn’t a procedure at all.
Any procedure in the implied chain of fulfillment can (and should) add! dependencies to the compiler as they are discovered. If this occurs, the subsequent procedure will not be called until those dependencies are fulfilled.
Once clarified names can be used to delegate work to procedures, you can compile!Fulfills all assets on the current thread and returns a hash mapping clear names to the final value associated with each asset. Will raise exn:fail if a call to compile! is already running for the instance.
The encapsulated model will record all asset activity.
Events are sent to unlike-asset-logger.
If changed or removed are not empty, then the compiler will first modify the underlying model to reflect changed or removed assets according to Responding to Change.Return the current value associated with a clear name in the compiler. Will raise exn:fail if no asset is found.Adds a clear asset name to the compiler. If dependent-clear is a clear name, then the compiler will understand that clear is a dependency of dependent-clear. Will raise exn:fail if a circular dependency forms.
ripple controls how a change in clear’s asset propagates to dependent-clear’s asset. By default, the dependent asset will be rebuilt. Otherwise the change will produce an asset value from a provided ripple/c procedure.For information on the change model, see Responding to Change.