From 2dc0757850f3c714592309a8abe2cf8789d0e7f5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 21 Jan 2009 19:55:47 -0600 Subject: [PATCH] Cleanups --- basis/heaps/heaps-tests.factor | 6 ++---- core/slots/slots.factor | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/basis/heaps/heaps-tests.factor b/basis/heaps/heaps-tests.factor index 8fa6a274e7..7e780cbe5e 100644 --- a/basis/heaps/heaps-tests.factor +++ b/basis/heaps/heaps-tests.factor @@ -32,10 +32,8 @@ IN: heaps.tests : random-alist ( n -- alist ) [ - [ - 32 random-bits dup number>string swap set - ] times - ] H{ } make-assoc ; + drop 32 random-bits dup number>string + ] H{ } map>assoc ; : test-heap-sort ( n -- ? ) random-alist dup >alist sort-keys swap heap-sort = ; diff --git a/core/slots/slots.factor b/core/slots/slots.factor index 99766cadc2..f166378d9d 100644 --- a/core/slots/slots.factor +++ b/core/slots/slots.factor @@ -1,9 +1,9 @@ -! Copyright (C) 2005, 2008 Slava Pestov. +! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: arrays byte-arrays kernel kernel.private math namespaces make sequences strings words effects generic generic.standard classes classes.algebra slots.private combinators accessors -words sequences.private assocs alien quotations ; +words sequences.private assocs alien quotations hashtables ; IN: slots TUPLE: slot-spec name offset class initial read-only ; @@ -86,7 +86,7 @@ ERROR: bad-slot-value value class ; ] [ ] make ; : writer-props ( slot-spec -- assoc ) - [ "writing" set ] H{ } make-assoc ; + "writing" associate ; : define-writer ( class slot-spec -- ) [ name>> writer-word ] [ writer-quot ] [ writer-props ] tri