Implemenation Ideas

Vocab loader

The vocabulary system has a problem where some vocabulary names are restricted but no error is thrown. For example, a vocabulary foo.private with the on-disk path of extra/foo/private/private.factor will never get loaded because the loader will want to load extra/foo/foo.factor instead. A possible fix is for foo.private to become foo:private and to make a first-class use object like TUPLE: use vocab subvocab ;. The use word would split on the : and the vocab would be everything to the left of the :, while the right part is the subvocab. While the only subvocab is private right now, we could have a primtives subvocab as well for core bootstrap. Then the kernel using list would look like: USING: kernel:primitives slots:primitives math:primitives ;. The vocabulary loader would decide whether to load vocabularies based on the subvocab.

Examples:

  • USE: math:private -> core/math/math.factor:private
  • USE: math:primitives -> core/math/math.factor:primitives
  • USE: math.private:private -> core/math/private/private.factor:private

This revision created on Tue, 27 Sep 2011 03:22:45 by erg