]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/calendar/format/format.factor
Fixing everything for mandatory stack effects
[factor.git] / extra / calendar / format / format.factor
index ff1811e9d595aacc58b4ff4e9149b4c6b8323f81..15dee790066fa795173fcc9ed0462c5bafc22ce9 100755 (executable)
@@ -4,46 +4,46 @@ combinators accessors debugger
 calendar calendar.format.macros ;\r
 IN: calendar.format\r
 \r
-: pad-00 number>string 2 CHAR: 0 pad-left ;\r
+: pad-00 ( n -- str ) number>string 2 CHAR: 0 pad-left ;\r
 \r
-: pad-0000 number>string 4 CHAR: 0 pad-left ;\r
+: pad-0000 ( n -- str ) number>string 4 CHAR: 0 pad-left ;\r
 \r
-: pad-00000 number>string 5 CHAR: 0 pad-left ;\r
+: pad-00000 ( n -- str ) number>string 5 CHAR: 0 pad-left ;\r
 \r
-: write-00 pad-00 write ;\r
+: write-00 ( n -- ) pad-00 write ;\r
 \r
-: write-0000 pad-0000 write ;\r
+: write-0000 ( n -- ) pad-0000 write ;\r
 \r
-: write-00000 pad-00000 write ;\r
+: write-00000 ( n -- ) pad-00000 write ;\r
 \r
-: hh hour>> write-00 ;\r
+: hh ( time -- ) hour>> write-00 ;\r
 \r
-: mm minute>> write-00 ;\r
+: mm ( time -- ) minute>> write-00 ;\r
 \r
-: ss second>> >integer write-00 ;\r
+: ss ( time -- ) second>> >integer write-00 ;\r
 \r
-: D day>> number>string write ;\r
+: D ( time -- ) day>> number>string write ;\r
 \r
-: DD day>> write-00 ;\r
+: DD ( time -- ) day>> write-00 ;\r
 \r
-: DAY day-of-week day-abbreviations3 nth write ;\r
+: DAY ( time -- ) day-of-week day-abbreviations3 nth write ;\r
 \r
-: MM month>> write-00 ;\r
+: MM ( time -- ) month>> write-00 ;\r
 \r
-: MONTH month>> month-abbreviations nth write ;\r
+: MONTH ( time -- ) month>> month-abbreviations nth write ;\r
 \r
-: YYYY year>> write-0000 ;\r
+: YYYY ( time -- ) year>> write-0000 ;\r
 \r
-: YYYYY year>> write-00000 ;\r
+: YYYYY ( time -- ) year>> write-00000 ;\r
 \r
 : expect ( str -- )\r
     read1 swap member? [ "Parse error" throw ] unless ;\r
 \r
-: read-00 2 read string>number ;\r
+: read-00 ( -- n ) 2 read string>number ;\r
 \r
-: read-000 3 read string>number ;\r
+: read-000 ( -- n ) 3 read string>number ;\r
 \r
-: read-0000 4 read string>number ;\r
+: read-0000 ( -- n ) 4 read string>number ;\r
 \r
 GENERIC: day. ( obj -- )\r
 \r
@@ -261,7 +261,7 @@ ERROR: invalid-timestamp-format ;
 : timestamp>ymd ( timestamp -- str )\r
     [ (timestamp>ymd) ] with-string-writer ;\r
 \r
-: (timestamp>hms)\r
+: (timestamp>hms) ( timestamp -- )\r
     { hh ":" mm ":" ss } formatted ;\r
 \r
 : timestamp>hms ( timestamp -- str )\r