From 7ccb51d3f12c88470cdca45c7418329195ccb552 Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Mon, 26 May 2008 15:50:15 +0000 Subject: [PATCH] Moving things to scheme/base svn: r9960 --- collects/profj/libs/java/lang/Comparable.ss | 7 ++--- .../profj/libs/java/lang/Object-composite.ss | 28 +++++++++++-------- collects/profj/libs/java/lang/Object.ss | 3 +- collects/profj/libs/java/lang/String.ss | 3 +- collects/profj/libs/java/lang/Throwable.ss | 5 ++-- collects/profj/libs/java/lang/array.ss | 3 +- collects/profj/libs/java/runtime.scm | 18 +++++------- 7 files changed, 32 insertions(+), 35 deletions(-) diff --git a/collects/profj/libs/java/lang/Comparable.ss b/collects/profj/libs/java/lang/Comparable.ss index ef8ae5d1f8..c531a56c2d 100644 --- a/collects/profj/libs/java/lang/Comparable.ss +++ b/collects/profj/libs/java/lang/Comparable.ss @@ -1,5 +1,4 @@ -#cs -(module Comparable mzscheme - (require mzlib/class) - (provide (all-defined)) +(module Comparable scheme/base + (require scheme/class) + (provide (all-defined-out)) (define Comparable (interface () compareTo-java.lang.Object))) diff --git a/collects/profj/libs/java/lang/Object-composite.ss b/collects/profj/libs/java/lang/Object-composite.ss index ce9c498d7b..45941f6d5c 100644 --- a/collects/profj/libs/java/lang/Object-composite.ss +++ b/collects/profj/libs/java/lang/Object-composite.ss @@ -1,12 +1,18 @@ -(module Object-composite mzscheme +(module Object-composite scheme/base - (require mzlib/class - (prefix c: mzlib/contract) - (lib "errortrace-lib.ss" "errortrace") - (lib "Comparable.ss" "profj" "libs" "java" "lang") - (lib "Serializable.ss" "profj" "libs" "java" "io")) + (require scheme/class + (prefix-in c: scheme/contract) + errortrace + + profj/libs/java/lang/Comparable + profj/libs/java/io/Serializable + #;(lib "Comparable.ss" "profj" "libs" "java" "lang") + #;(lib "Serializable.ss" "profj" "libs" "java" "io")) (require "compile-lang-syntax.ss") + (define make-hash-table make-hash) + (define hash-table-put! hash-set!) + ;Runtime needed code (define (javaRuntime:convert-to-string data) (cond @@ -109,7 +115,7 @@ (if (string? obj) (make-java-string string) (begin - (c:contract (c:object-contract + (c:contract (object-contract (clone (c:-> c:any/c)) (equals-java.lang.Object (c:-> c:any/c c:any/c)) (finalize (c:-> c:any/c)) @@ -446,7 +452,7 @@ (define (is-java-array? obj) (is-a? obj java-array)) - (define-struct runtime-type (type dim) (make-inspector)) + (define-struct runtime-type (type dim) #:transparent) (define (array->list array start stop) (if (= start stop) @@ -879,7 +885,7 @@ ; ;Throwable and exceptions - (provide Throwable (struct java:exception (object)) + (provide Throwable (struct-out java:exception) exception-is-a? handle-exception create-java-exception) (define Throwable @@ -987,7 +993,7 @@ ;(make-java-exception string continuation-mark-set Throwable) ;Where Throwable is an object descending from class Throwable - (define-struct (java:exception exn) (object)) + (define-struct (java:exception exn) (object) #:mutable) ;exception-is-a?: class -> (exn -> bool) (define (exception-is-a? class) @@ -1019,7 +1025,7 @@ guard-convert-Throwable static-Throwable/c) (define (wrap-convert-assert-Throwable obj p n s c) - (c:contract (c:object-contract + (c:contract (object-contract (init-cause (c:-> c:any/c c:any/c)) (get-message (c:-> c:any/c)) (get-cause (c:-> c:any/c)) diff --git a/collects/profj/libs/java/lang/Object.ss b/collects/profj/libs/java/lang/Object.ss index 392889d422..bfab608277 100644 --- a/collects/profj/libs/java/lang/Object.ss +++ b/collects/profj/libs/java/lang/Object.ss @@ -1,5 +1,4 @@ -#cs -(module Object mzscheme +(module Object scheme/base (require "Object-composite.ss") (provide ObjectI Object-Mix Object) (provide guard-convert-Object convert-assert-Object wrap-convert-assert-Object diff --git a/collects/profj/libs/java/lang/String.ss b/collects/profj/libs/java/lang/String.ss index 184c1645ff..aa56e865b2 100644 --- a/collects/profj/libs/java/lang/String.ss +++ b/collects/profj/libs/java/lang/String.ss @@ -1,5 +1,4 @@ -#cs -(module String mzscheme +(module String scheme/base (require "Object-composite.ss") (provide make-java-string String String-valueOf-java.lang.Object String-valueOf-char1 String-valueOf-char1-int-int String-copyValueOf-char1-int-int String-copyValueOf-char1 diff --git a/collects/profj/libs/java/lang/Throwable.ss b/collects/profj/libs/java/lang/Throwable.ss index 03f8420c8f..1d627ee1ec 100644 --- a/collects/profj/libs/java/lang/Throwable.ss +++ b/collects/profj/libs/java/lang/Throwable.ss @@ -1,7 +1,6 @@ -#cs -(module Throwable mzscheme +(module Throwable scheme/base (require "Object-composite.ss") - (provide Throwable (struct java:exception (object)) + (provide Throwable (struct-out java:exception) exception-is-a? handle-exception create-java-exception) (provide guard-convert-Throwable convert-assert-Throwable wrap-convert-assert-Throwable dynamic-Throwable/c static-Throwable/c)) diff --git a/collects/profj/libs/java/lang/array.ss b/collects/profj/libs/java/lang/array.ss index 1409c4d9d3..d8c61c4a5e 100644 --- a/collects/profj/libs/java/lang/array.ss +++ b/collects/profj/libs/java/lang/array.ss @@ -1,4 +1,3 @@ -#cs -(module array mzscheme +(module array scheme/base (require "Object-composite.ss") (provide make-java-array is-java-array? make-runtime-type array->list)) diff --git a/collects/profj/libs/java/runtime.scm b/collects/profj/libs/java/runtime.scm index 4affe8aa71..8635cf1b9c 100644 --- a/collects/profj/libs/java/runtime.scm +++ b/collects/profj/libs/java/runtime.scm @@ -1,20 +1,16 @@ ;Java runtime utilities ;Kathryn Gray -;July 2001 - -;This module provides functions needed at runtime for compiled Java code - -(module runtime mzscheme +(module runtime scheme/base - (require mzlib/class - mzlib/list + (require scheme/class + scheme/list + profj/libs/java/lang/Object profj/libs/java/lang/String profj/libs/java/lang/Throwable - (lib "ArithmeticException.ss" "profj" "libs" "java" "lang") - (lib "ClassCastException.ss" "profj" "libs" "java" "lang") - (lib "NullPointerException.ss" "profj" "libs" "java" "lang") - (prefix ast: (lib "ast.ss" "profj")) + profj/libs/java/lang/ArithmeticException + profj/libs/java/lang/ClassCastException + profj/libs/java/lang/NullPointerException ) (provide convert-to-string shift not-equal bitwise mod divide-dynamic divide-int