[plt-scheme] polymorphism of primitive types

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Tue Oct 18 10:38:19 EDT 2005

Yoav Goldberg wrote:
> When using module as modules, this can be easily done:
> (module my-prog1 mzscheme
>   (require "my-seq.ss")
>   ..)
> (module my-prog2 mzscheme
>   (require "my-arith.ss")
>   (require "my-seq.ss")
>   ..)
> 
> but when using modules as language, I would have to create a new language
> for every combination I want to use..

I suppose one could make a module "empty" that contains nothing
but #%module-begin and #%require. And also

   mymzscheme.ss      mzscheme without arithmetic and list operations
   list.ss            mzscheme list operations
   arithmetic.ss      mzscheme arithmetic

Then it would be no problem replacing

(module "empty.ss"
   (require "mymzscheme.ss")
            "arithmetic.ss"
	   "list.ss")
   ...)

with, say,

(module "empty.ss"
   (require "mymzscheme.ss")
            "myarithmetic.ss"
	   "list.ss")
   ...)

or

(module "empty.ss"
   (require "mymzscheme.ss")
            "arithmetic.ss"
	   "mylist.ss")
   ...)


-- 
Jens Axel Søgaard




Posted on the users mailing list.