On 12/19/06, John Cowan <[EMAIL PROTECTED]> wrote:
I've read over the PLT Scheme approach, and I think I see how it can be adapted to Chicken. Basically, the syntax of the export declaration is extended to provide per-procedure argument and result checking, and a new declaration is added to provide module invariants. [...] What do you think?
I like this very much. But wouldn't it be better to use a new form, instead of adding yet more functionality to "declare"? Perhaps a catchall "contract" macro, that performs per-file declarations (possibly with support by the compiler, possibly be doing the very (declare (export ...)) behind the scenes): ;;; some file (contract (export (plus (-> (number? number?) number?)) (plus/all (-> (number? . (list-of number?)) number?)) (exact->div0+mod0 (-> (exact? exact?) (exact? exact?)))) (invariant ...)) ... Hm... there might be better approaches. Anyway, you specified semantics that look good to me, I just would like to avoid using "declare" for this purpose. cheers, felix _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
