Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
7
Task/Sleep/Quackery/sleep.quackery
Normal file
7
Task/Sleep/Quackery/sleep.quackery
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[ $ \import time
|
||||
time.sleep(from_stack())\
|
||||
python ] is sleep ( seconds --> )
|
||||
|
||||
say "Sleeping..."
|
||||
10 sleep
|
||||
say "Awake!"
|
||||
12
Task/Sleep/Standard-ML/sleep-1.ml
Normal file
12
Task/Sleep/Standard-ML/sleep-1.ml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fun doSleep () =
|
||||
let
|
||||
val maybeline = TextIO.inputLine TextIO.stdIn
|
||||
val line = if isSome maybeline then valOf maybeline else raise Fail "Enter a number of seconds"
|
||||
val maybesecs = Real.fromString line
|
||||
val secs = if isSome maybesecs then valOf maybesecs else raise Fail "Bad number entered"
|
||||
val () = print "Sleeping...\n"
|
||||
val () = OS.Process.sleep (Time.fromReal secs)
|
||||
val () = print "Awake!\n"
|
||||
in
|
||||
()
|
||||
end
|
||||
2
Task/Sleep/Standard-ML/sleep-2.ml
Normal file
2
Task/Sleep/Standard-ML/sleep-2.ml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(* load the above function in the REPL and then: *)
|
||||
PolyML.export("doSleep.o", doSleep);
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
(TextIO.print "input a number of seconds please: ";
|
||||
let val seconds = valOf (Int.fromString (valOf (TextIO.inputLine TextIO.stdIn))) in
|
||||
TextIO.print "Sleeping...\n";
|
||||
OS.Process.sleep (Time.fromReal seconds); (* it takes a Time.time data structure as arg,
|
||||
but in my implementation it seems to round down to the nearest second.
|
||||
I dunno why; it doesn't say anything about this in the documentation *)
|
||||
TextIO.print "Awake!\n"
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue