From 7a3a801bde4284e99a86ea5964ec0c9e93272f2b Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 4 Mar 2013 16:09:56 -0800 Subject: [PATCH] words: adding inline-recursive?. --- basis/compiler/tree/builder/builder.factor | 3 --- core/words/words.factor | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/basis/compiler/tree/builder/builder.factor b/basis/compiler/tree/builder/builder.factor index a13c5a695e..7f7dfdc4b5 100644 --- a/basis/compiler/tree/builder/builder.factor +++ b/basis/compiler/tree/builder/builder.factor @@ -20,9 +20,6 @@ M: callable (build-tree) infer-quot-here ; : check-no-compile ( word -- ) dup "no-compile" word-prop [ do-not-compile ] [ drop ] if ; -: inline-recursive? ( word -- ? ) - [ "inline" word-prop ] [ "recursive" word-prop ] bi and ; - : word-body ( word -- quot ) dup inline-recursive? [ 1quotation ] [ specialized-def ] if ; diff --git a/core/words/words.factor b/core/words/words.factor index 47a7531b34..d338d7f576 100644 --- a/core/words/words.factor +++ b/core/words/words.factor @@ -108,6 +108,10 @@ M: word parent-word drop f ; : inline? ( word -- ? ) "inline" word-prop ; inline +: inline-recursive? ( word -- ? ) + dup "inline" word-prop + [ "recursive" word-prop ] [ drop f ] if ; inline + ERROR: cannot-be-inline word ; GENERIC: make-inline ( word -- )