From 89440b2a2316f101c73f5462dd7f1e2c9f73dd1f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 21 Nov 2008 04:37:17 -0600 Subject: [PATCH] curry and compose now check their inputs --- core/bootstrap/primitives.factor | 19 +++++++++++++++++-- core/quotations/quotations-tests.factor | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index 20113d0e25..65731dd1ad 100644 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -303,7 +303,13 @@ tuple [ f "inline" set-word-prop ] [ make-flushable ] [ ] - [ tuple-layout [ ] curry ] + [ + [ + callable instance-check-quot % + tuple-layout , + \ , + ] [ ] make + ] } cleave (( obj quot -- curry )) define-declared @@ -319,7 +325,16 @@ tuple [ f "inline" set-word-prop ] [ make-flushable ] [ ] - [ tuple-layout [ ] curry ] + [ + [ + \ >r , + callable instance-check-quot % + \ r> , + callable instance-check-quot % + tuple-layout , + \ , + ] [ ] make + ] } cleave (( quot1 quot2 -- compose )) define-declared diff --git a/core/quotations/quotations-tests.factor b/core/quotations/quotations-tests.factor index d311dfad71..29e1304334 100644 --- a/core/quotations/quotations-tests.factor +++ b/core/quotations/quotations-tests.factor @@ -15,4 +15,4 @@ IN: quotations.tests [ [ "hi" ] ] [ "hi" 1quotation ] unit-test -! [ 1 \ + curry ] must-fail +[ 1 \ + curry ] must-fail