io.files.unique: change cleanup-unique-file quot stack effect.

locals-and-roots
John Benediktsson 2016-03-19 13:03:15 -07:00
parent 20883fb21a
commit 50759f4bc6
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ HELP: unique-file
{ unique-file cleanup-unique-file } related-words
HELP: cleanup-unique-file
{ $values { "prefix" string } { "suffix" string } { "quot" { $quotation ( path -- ) } } }
{ $values { "prefix" string } { "suffix" string } { "quot" { $quotation ( ..a path -- ..b ) } } }
{ $description "Creates a file with " { $link unique-file } " and calls the quotation with the path name on the stack." }
{ $notes "The unique file will be deleted after calling this word, even if an error is thrown in the quotation." } ;

View File

@ -36,7 +36,7 @@ PRIVATE>
dup touch-unique-file
] unique-retries get retry absolute-path ;
:: cleanup-unique-file ( prefix suffix quot: ( path -- ) -- )
:: cleanup-unique-file ( ..a prefix suffix quot: ( ..a path -- ..b ) -- ..b )
prefix suffix unique-file :> path
[ path quot call ] [ path delete-file ] [ ] cleanup ; inline