[plt-scheme] foreign and contract interaction

From: David Van Horn (dvanhorn at cs.uvm.edu)
Date: Fri Apr 15 13:31:34 EDT 2005

There is an unfortunate interaction between foreign.ss and contract.ss as 
evinced by these two programs:

(require (lib "foreign.ss"))
(_fun -> _int) ;=> #<ctype>

(require (lib "foreign.ss") (lib "contract.ss"))
(_fun -> _int) ;=> _fun: missing output type in: (_fun -> _int)

The problem appears to be that foreign uses `->' as a keyword, and contract 
defines `->' as a macro.  The module system doesn't catch this statically, and 
the error message is not helpful, but this seems to be a work-around:

(require (rename (lib "contract.ss") --> ->))


Posted on the users mailing list.