 #
 # Provides the basic methods needed to load packages and any functions
 # useful enough to live in the core.
-#
-# NOTE: Much of the package stuff is drawn from Dojo, which is a project
-# that is arguably over-engineered and generally stuffy, but hopefully
-# taking a small slice out of it will not spread the seeds of doom.
 #
 
 if window? and not GLOBAL?

  # Transforms an array of module parts to a list of possible Uris.
  # @method _getUrisForParts
  # @param parts {Array} The list of module parts.
  # @param lookForPackages {Boolean} Whether to look for a package file at all.
  # @param preferPackages {Boolean} Whether to look for a package file first.
  # @private
  #
  _getUrisForParts: (parts, scheme, lookForPackages, preferPackages) ->
    s = wesabe.baseUrlForScheme(scheme)
    u = (pp) ->
      base = [s].concat(pp).join('/')

  #   # looks for files in this order:
  #   # wesabe/math/vector.js
  #   # wesabe/math.js
  #   wesabe.require("math.vector");
  #
  #   # specifying an asterisk last changes the order:
  #   # wesabe/math/vector.js
  #   # wesabe/math.js
  #
  require: (module) ->
    return required[module].exports if required[module]
