Documentation fixes

db4
Slava Pestov 2008-05-05 19:41:44 -05:00
parent 8e60cf2b86
commit 598ba7dedb
4 changed files with 14 additions and 7 deletions

View File

@ -116,10 +116,13 @@ $nl
"Other threads may interrupt the sleep by calling " { $link interrupt } "." } ;
HELP: sleep
{ $values { "ms" "a non-negative integer" } }
{ $description "Suspends the current thread for " { $snippet "ms" } " milliseconds."
{ $values { "dt" "a duration" } }
{ $description "Suspends the current thread for the given duration."
$nl
"Other threads may interrupt the sleep by calling " { $link interrupt } "." } ;
"Other threads may interrupt the sleep by calling " { $link interrupt } "." }
{ $examples
{ $code "USING: threads calendar ;" "10 seconds sleep" }
} ;
HELP: interrupt
{ $values { "thread" thread } }

View File

@ -93,7 +93,7 @@ PRIVATE>
<PRIVATE
: schedule-sleep ( thread ms -- )
: schedule-sleep ( thread dt -- )
>r check-registered dup r> sleep-queue heap-push*
>>sleep-entry drop ;
@ -153,7 +153,7 @@ M: integer sleep-until
M: f sleep-until
drop [ drop ] "interrupt" suspend drop ;
GENERIC: sleep ( ms -- )
GENERIC: sleep ( dt -- )
M: real sleep
millis + >integer sleep-until ;

View File

@ -135,7 +135,7 @@ $nl
{ $code "[ Letter? ] filter >lower" }
"This code starts with a string on the stack, removes non-alphabetical characters, and converts the result to lower case, leaving a new string on the stack. We put this code in a new word, and add the new word to " { $snippet "palindrome.factor" } ":"
{ $code ": normalize ( str -- newstr ) [ Letter? ] filter >lower ;" }
"You will need to add " { $vocab-link "unicode.categories" } " to the vocabulary search path, so that " { $link Letter? } " can be used in the source file."
"You will need to add " { $vocab-link "unicode.case" } " and " { $vocab-link "unicode.categories" } " to the vocabulary search path, so that " { $link Letter? } " can be used in the source file."
$nl
"We modify " { $snippet "palindrome?" } " to first apply " { $snippet "normalize" } " to its input:"
{ $code ": palindrome? ( str -- ? ) normalize dup reverse = ;" }

View File

@ -24,6 +24,10 @@ HELP: morse>
{ $description "Translates morse code into ASCII text" }
{ $see-also >morse morse>ch } ;
HELP: play-as-morse
HELP: play-as-morse*
{ $values { "str" "A string of ascii characters which can be translated into morse code" } { "unit-length" "The length of a dot" } }
{ $description "Plays a string as morse code" } ;
HELP: play-as-morse
{ $values { "str" "A string of ascii characters which can be translated into morse code" } }
{ $description "Plays a string as morse code" } ;