diff --git a/core/threads/threads-docs.factor b/core/threads/threads-docs.factor index 3f9ff54ac8..7d8791d493 100755 --- a/core/threads/threads-docs.factor +++ b/core/threads/threads-docs.factor @@ -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 } } diff --git a/core/threads/threads.factor b/core/threads/threads.factor index 8b89cd5732..cbca7ac029 100755 --- a/core/threads/threads.factor +++ b/core/threads/threads.factor @@ -93,7 +93,7 @@ PRIVATE> 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 ; diff --git a/extra/help/tutorial/tutorial.factor b/extra/help/tutorial/tutorial.factor index fffcda69b6..cafa758c7e 100755 --- a/extra/help/tutorial/tutorial.factor +++ b/extra/help/tutorial/tutorial.factor @@ -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 = ;" } diff --git a/extra/morse/morse-docs.factor b/extra/morse/morse-docs.factor index f31b741c85..e35967d3e9 100644 --- a/extra/morse/morse-docs.factor +++ b/extra/morse/morse-docs.factor @@ -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" } ;