diff --git a/runtime/Ieee/string-generic.sch b/runtime/Ieee/string-generic.sch index bca8659b..952ccb61 100644 --- a/runtime/Ieee/string-generic.sch +++ b/runtime/Ieee/string-generic.sch @@ -3,7 +3,7 @@ ;* ------------------------------------------------------------- */ ;* Author : Manuel Serrano */ ;* Creation : Tue Jul 9 13:49:25 2024 */ -;* Last change : Tue Jul 9 14:03:02 2024 (serrano) */ +;* Last change : Wed Jul 10 08:29:12 2024 (serrano) */ ;* Copyright : 2024 Manuel Serrano */ ;* ------------------------------------------------------------- */ ;* Generic portable string implementation. */ @@ -13,7 +13,8 @@ ;* The directives */ ;*---------------------------------------------------------------------*/ (directives - (export ($$substring=?::bool ::bstring ::bstring ::long))) + (export ($$substring=?::bool ::bstring ::bstring ::long) + ($$string=?::bool ::bstring ::bstring))) ;*---------------------------------------------------------------------*/ ;* $$substring=? ... */ @@ -30,3 +31,12 @@ (else #f))))) +;*---------------------------------------------------------------------*/ +;* $$string=? ... */ +;*---------------------------------------------------------------------*/ +(define ($$string=? string1 string2) + (let ((l1 (string-length string1)) + (l2 (string-length string2))) + (and (=fx l1 l2) ($$substring=? string1 string2 l1)))) + + diff --git a/runtime/Ieee/string.scm b/runtime/Ieee/string.scm index 29950ffa..d4339a74 100644 --- a/runtime/Ieee/string.scm +++ b/runtime/Ieee/string.scm @@ -3,7 +3,7 @@ ;* ------------------------------------------------------------- */ ;* Author : Manuel Serrano */ ;* Creation : Mon Mar 20 19:17:18 1995 */ -;* Last change : Tue Jul 9 14:02:12 2024 (serrano) */ +;* Last change : Wed Jul 10 08:29:01 2024 (serrano) */ ;* ------------------------------------------------------------- */ ;* 6.7. Strings (page 25, r4) */ ;* ------------------------------------------------------------- */ @@ -357,8 +357,10 @@ (let ((l1 (string-length string1))) (when (=fx l1 (string-length string2)) (=fx ($memcmp string1 string2 l1) 0)))) + (bigloo-jvm + ($string=? string1 string2)) (else - ($string=? string1 string2)))) + ($$string=? string1 string2)))) ;*---------------------------------------------------------------------*/ ;* @deffn substring=?@ ... */ diff --git a/runtime/Ieee/symbol-generic.sch b/runtime/Ieee/symbol-generic.sch index 5013f2df..2363c656 100644 --- a/runtime/Ieee/symbol-generic.sch +++ b/runtime/Ieee/symbol-generic.sch @@ -3,7 +3,7 @@ ;* ------------------------------------------------------------- */ ;* Author : Manuel Serrano */ ;* Creation : Tue Jul 9 13:46:43 2024 */ -;* Last change : Tue Jul 9 14:01:11 2024 (serrano) */ +;* Last change : Wed Jul 10 08:26:36 2024 (serrano) */ ;* Copyright : 2024 Manuel Serrano */ ;* ------------------------------------------------------------- */ ;* Symbol generic implementation */ @@ -13,7 +13,8 @@ ;* The directives */ ;*---------------------------------------------------------------------*/ (directives - (export ($$bstring->symbol::symbol ::bstring))) + (export ($$bstring->symbol::symbol ::bstring) + ($$bkeyword->symbol::keyword ::bstring))) ;*---------------------------------------------------------------------*/ ;* symbol table */ @@ -33,5 +34,23 @@ (set! *symbol-table* (cons (cons string sym) *symbol-table*)) sym))))) +;*---------------------------------------------------------------------*/ +;* keyword table */ +;*---------------------------------------------------------------------*/ +(define *keyword-mutex* (make-mutex)) +(define *keyword-table* '()) + +;*---------------------------------------------------------------------*/ +;* $$bstring->keyword ... */ +;*---------------------------------------------------------------------*/ +(define ($$bstring->keyword string) + (synchronize *keyword-mutex* + (let ((old (assoc string *keyword-table*))) + (if (pair? old) + (cdr old) + (let ((sym ($make-keyword string))) + (set! *keyword-table* (cons (cons string sym) *keyword-table*)) + sym))))) + diff --git a/runtime/Jlib/foreign.java b/runtime/Jlib/foreign.java index bcd1ebf2..8817dc37 100644 --- a/runtime/Jlib/foreign.java +++ b/runtime/Jlib/foreign.java @@ -5753,7 +5753,7 @@ public static Object bgl_time( procedure p ) { res = p.funcall0(); end = System.currentTimeMillis(); - env.mvalues_number = 1; + env.mvalues_number = 4; env.mvalues_values[ 1 ] = BINT( end - start ); env.mvalues_values[ 2 ] = BINT( 0 ); env.mvalues_values[ 3 ] = BINT( 0 ); diff --git a/runtime/Llib/bigloo.scm b/runtime/Llib/bigloo.scm index 3ffaa56b..4427a343 100644 --- a/runtime/Llib/bigloo.scm +++ b/runtime/Llib/bigloo.scm @@ -3,7 +3,7 @@ ;* ------------------------------------------------------------- */ ;* Author : Manuel Serrano */ ;* Creation : Fri Jan 20 08:24:40 1995 */ -;* Last change : Fri Jul 5 10:02:37 2024 (serrano) */ +;* Last change : Wed Jul 10 08:31:14 2024 (serrano) */ ;* ------------------------------------------------------------- */ ;* The bigloo runtime utility functions */ ;*=====================================================================*/ @@ -692,7 +692,11 @@ ;*---------------------------------------------------------------------*/ (define (time proc) (if (correct-arity? proc 0) - ($time proc) + (cond-expand + ((or bigloo-c bigloo-jvm) + ($time proc)) + (else + (values (proc) 0 0 0))) (error 'time "Wrong procedure arity" proc))) ;*---------------------------------------------------------------------*/