From 144f79ffabe5cd0818a1a71fc87e672500ece9e9 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 29 Aug 2008 01:59:25 -0500 Subject: [PATCH] use ERROR: instead of throwing strings --- basis/mirrors/mirrors.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basis/mirrors/mirrors.factor b/basis/mirrors/mirrors.factor index 641fce6efc..ce99314ce6 100755 --- a/basis/mirrors/mirrors.factor +++ b/basis/mirrors/mirrors.factor @@ -16,10 +16,13 @@ M: mirror at* [ nip object>> ] [ object-slots slot-named ] 2bi dup [ offset>> slot t ] [ 2drop f f ] if ; +ERROR: no-such-slot slot ; +ERROR: read-only-slot slot ; + : check-set-slot ( val slot -- val offset ) { - { [ dup not ] [ "No such slot" throw ] } - { [ dup read-only>> ] [ "Read only slot" throw ] } + { [ dup not ] [ no-such-slot ] } + { [ dup read-only>> ] [ read-only-slot ] } { [ 2dup class>> instance? not ] [ class>> bad-slot-value ] } [ offset>> ] } cond ; inline