]> gitweb.factorcode.org Git - factor.git/commitdiff
Check for words which are not classes but have a $class-description element anyway
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 10 Mar 2009 22:28:17 +0000 (17:28 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 10 Mar 2009 22:28:17 +0000 (17:28 -0500)
basis/help/lint/lint.factor

index 57f64459c86c3362397ef78d6c656b2729dc7378..2281c295c394429fa0a9d57e5253e28497e4037c 100755 (executable)
@@ -132,6 +132,11 @@ SYMBOL: vocabs-quot
         [ check-descriptions ]
     } cleave ;
 
+: check-class-description ( word element -- )
+    [ class? not ]
+    [ { $class-description } swap elements empty? not ] bi* and
+    [ "A word that is not a class has a $class-description" throw ] when ;
+
 : all-word-help ( words -- seq )
     [ word-help ] filter ;
 
@@ -153,7 +158,8 @@ M: help-error error.
         dup '[
             _ dup word-help
             [ check-values ]
-            [ nip [ check-nulls ] [ check-see-also ] [ check-markup ] tri ] 2bi
+            [ check-class-description ]
+            [ nip [ check-nulls ] [ check-see-also ] [ check-markup ] tri ] 2tri
         ] check-something
     ] [ drop ] if ;