From 3e7af333436d21df0561de2eb8b31481d833436e Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Tue, 30 Nov 2010 04:53:11 +0900 Subject: [PATCH] hints: fix two examples and formatting in docs --- basis/hints/hints-docs.factor | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/basis/hints/hints-docs.factor b/basis/hints/hints-docs.factor index 46bdc698b7..4ff973a251 100644 --- a/basis/hints/hints-docs.factor +++ b/basis/hints/hints-docs.factor @@ -24,20 +24,26 @@ HELP: HINTS: { $description "Defines specialization hints for a word or a method." $nl "Each sequence in the list will cause a specialized version of the word to be compiled. Classes are tested for using their predicate, and literals are tested using " { $link eq? } "." } -{ $examples "The " { $link append } " word has a specializer for the very common case where two strings or two arrays are appended:" -{ $code "HINTS: append { string string } { array array } ;" } -"Specializers can also be defined on methods:" -{ $code - "GENERIC: count-occurrences ( elt obj -- n )" - "" - "M: sequence count-occurrences [ = ] with count ;" - "" - "M: assoc count-occurrences" - " swap [ = nip ] curry assoc-filter assoc-size ;" - "" - "HINTS: M\ sequence count-occurrences { object array } ;" - "HINTS: M\ assoc count-occurrences { object hashtable } ;" -} +{ $examples + "The " { $link append } " word has a specializer for the very common case where two strings or two arrays are appended:" + { $code + "USING: arrays hints sequences strings syntax ;" + "HINTS: append { string string } { array array } ;" + } + "Specializers can also be defined on methods:" + { $code + "USING: assocs hashtables hints kernel sequences" + "syntax ;" + "GENERIC: count-occurrences ( elt obj -- n )" + "" + "M: sequence count-occurrences [ = ] with count ;" + "" + "M: assoc count-occurrences" + " swap [ = nip ] curry assoc-filter assoc-size ;" + "" + "HINTS: M\\ sequence count-occurrences { object array } ;" + "HINTS: M\\ assoc count-occurrences { object hashtable } ;" + } } ; ABOUT: "hints"