]> gitweb.factorcode.org Git - factor.git/commitdiff
help.lint.checks: allow $slot to be used with struct-class.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 9 Jun 2014 01:12:26 +0000 (18:12 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 9 Jun 2014 01:12:26 +0000 (18:12 -0700)
basis/help/lint/checks/checks.factor

index 288e46cda74906ab8c57780f29b1cbb4ab137d52..a916a1bdcb21fa38cdd3f6adb4998e15f1d79052 100644 (file)
@@ -1,11 +1,12 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs classes classes.tuple combinators
-combinators.short-circuit debugger definitions effects eval
-formatting fry grouping help help.markup help.topics io
-io.streams.string kernel macros namespaces sequences
-sequences.deep sets splitting strings summary unicode.categories
-vocabs vocabs.loader words words.constant words.symbol ;
+USING: accessors arrays assocs classes classes.struct
+classes.tuple combinators combinators.short-circuit debugger
+definitions effects eval formatting fry grouping help
+help.markup help.topics io io.streams.string kernel macros
+namespaces sequences sequences.deep sets splitting strings
+summary unicode.categories vocabs vocabs.loader words
+words.constant words.symbol ;
 FROM: sets => members ;
 IN: help.lint.checks
 
@@ -152,7 +153,10 @@ SYMBOL: vocab-articles
 
 : check-class-description ( word element -- )
     \ $class-description swap elements over class? [
-        [ all-slots [ name>> ] map ] [ extract-slots ] bi*
+        [
+            dup struct-class? [ struct-slots ] [ all-slots ] if
+            [ name>> ] map
+        ] [ extract-slots ] bi*
         [ swap member? not ] with filter [
             ", " join "Described $slot does not exist: " prepend
             simple-lint-error