((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/date-literals" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "eggs" "literals" "srfi-19" "date-literals") (toc)) (section 2 "Date-literals" (p "A reader extension providing " (int-link "SRFI-19") " date/time literals of the form " (tt "#@2007-12-31T23:59:59Z") ".") (section 3 "Examples" (section 4 "Using date/time literals in the interpreter" (p "Loading " (tt "date-literals") " also loads " (tt "srfi-19") " and allows using date/time literals as follows:") (highlight scheme "#;1> (use date-literals)\n\n#;2> (current-date)\n#@2007-03-26T09:55:54Z\n\n#;3> #@2007-12-31T23:59:59Z\n#@2007-12-31T23:59:59Z\n\n#;4> ,d #@2007-12-31\nstructure of type `date'\n...\n\n#;5> ,x #@2007-12-31\n(make-date 0 0 0 0 31 12 2007 7200)")) (section 4 "Using date/time literals with the compiler" (p "Passing a " (tt "-X date-literals") " command-line option to " (tt "csc") " allows you to conveniently make use of date/time literals in your egg or compiled program without making the " (tt "date-literals") " egg a runtime dependency."))) (section 3 "Author" (p (int-link "/users/arto-bendiken" "Arto Bendiken"))) (section 3 "Requires" (ul (li (int-link "srfi-19")))) (section 3 "Reader extensions" (p "This egg installs a reader extension for " (tt "#\\@") " that reads a date/time literal as described below in " (tt "read-date-literal") ". Additionally, a record printer is installed so that all SRFI-19 date objects are automatically printed using " (tt "write-date-literal") ".") (p "Note that there are some caveats to using reader extensions when compiling; for more details, refer to the relevant " (int-link "/man/4/faq#Why does {{define-reader-ctor}} not work in my compiled program?" "FAQ entry") ".")) (section 3 "Input and output" (section 4 "read-date-literal" (def (sig (procedure "(read-date-literal [PORT])" (id read-date-literal))) (p "Reads a date/time literal from " (tt "PORT") ", which defaults to the value of " (tt "(current-input-port)") ". The literal is converted to an SRFI-19 date using the first matching format template as follows:") (ul (li (tt "#@~Y-~m-~dT~H:~M:~S~z")) (li (tt "#@~Y-~m-~dT~H:~M:~S")) (li (tt "#@~Y-~m-~d"))))) (section 4 "write-date-literal" (def (sig (procedure "(write-date-literal DATE [PORT])" (id write-date-literal))) (p "Writes the SRFI-19 date object " (tt "DATE") " in " (tt "#@~Y-~m-~dT~H:~M:~S~z") " format to " (tt "PORT") ", which defaults to the value of " (tt "(current-output-port)") ".")))) (section 3 "License" (pre " Copyright (c) 2006-2007 Arto Bendiken.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to\n deal in the Software without restriction, including without limitation the\n rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n sell copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n IN THE SOFTWARE.")) (section 3 "Version history" (dl (dt "1.0.2") (dd "Renamed the exported procedures for greater sanity.") (dt "1.0.1") (dd "Renamed the egg to " (tt "date-literals") " and made it compilable.") (dt "1.0.0") (dd "Initial release of " (tt "date-syntax") " egg for use in the interpreter.")))))