Skip to content

Commit

Permalink
Prepare portable hash numbers (bootstrap)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-serrano committed Aug 1, 2024
1 parent d384f3b commit d21c693
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
28 changes: 28 additions & 0 deletions runtime/Llib/hash-generic.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
;*=====================================================================*/
;* .../prgm/project/bigloo/bigloo/runtime/Llib/hash-generic.sch */
;* ------------------------------------------------------------- */
;* Author : Manuel Serrano */
;* Creation : Tue Jul 9 13:49:25 2024 */
;* Last change : Thu Aug 1 14:44:46 2024 (serrano) */
;* Copyright : 2024 Manuel Serrano */
;* ------------------------------------------------------------- */
;* Generic portable hash implementation. */
;*=====================================================================*/

;*---------------------------------------------------------------------*/
;* The directives */
;*---------------------------------------------------------------------*/
(directives
(export (bgl_obj_hash_number::long ::obj))
(extern (export bgl_obj_hash_number "bgl_obj_hash_number")))

;*---------------------------------------------------------------------*/
;* bgl_obj_hash_number ... */
;*---------------------------------------------------------------------*/
(define (bgl_obj_hash_number obj)
(cond
((vector? obj) 17)
((object? obj) 27)
(else 23)))


8 changes: 6 additions & 2 deletions runtime/Llib/hash.scm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
;*=====================================================================*/
;* serrano/prgm/project/bigloo/bigloo/hash-bad.scm */
;* serrano/prgm/project/bigloo/bigloo/runtime/Llib/hash.scm */
;* ------------------------------------------------------------- */
;* Author : Manuel Serrano */
;* Creation : Thu Sep 1 08:51:06 1994 */
;* Last change : Fri Jun 2 08:14:11 2023 (serrano) */
;* Last change : Thu Aug 1 14:40:09 2024 (serrano) */
;* ------------------------------------------------------------- */
;* The hash tables. */
;* ------------------------------------------------------------- */
Expand All @@ -17,6 +17,10 @@
;*---------------------------------------------------------------------*/
(module __hash

(cond-expand
((and (not bigloo-c) (not bigloo-jvm))
(include "Llib/hash-generic.sch")))

(import __error
__r4_symbols_6_4
__param
Expand Down

0 comments on commit d21c693

Please sign in to comment.