Summary
format-date reports bad argument count
Metadata
- Id: 172446cfee28ad7a015550e136164a3fd4b194a1
- Trac id: 1791
- Type: defect
- Reporter: nxg
- Owner: kon
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: worksforme
- Priority: major
- Milestone: someday
- Version: 5.2.0
- Changetime: 2022-06-26 00:00:48 UTC
- Created: 2021-10-14 16:35:06 UTC
- Keywords:
Description
When I try to evaluate the following program with csi, I get an error
% cat try.scm (import srfi-19-date srfi-19-io) (write (format-date "~Y-~m-~d" (current-date))) % csi try.scm CHICKEN (c) 2008-2020, The CHICKEN Team (c) 2000-2007, Felix L. Winkelmann Version 5.2.0 (rev 317468e4) macosx-unix-clang-x86-64 [ 64bit dload ptables ] Type ,? for help. ; loading try.scm ... ; loading /Data/tools/chicken-5.2.0/lib/chicken/11/srfi-19-date.import.so ... ; loading /Data/tools/chicken-5.2.0/lib/chicken/11/srfi-19-io.import.so ... ; loading /Data/tools/chicken-5.2.0/lib/chicken/11/srfi-19-date.so ... ; loading /Data/tools/chicken-5.2.0/lib/chicken/11/srfi-1.so ... [..blah...] ; loading /Data/tools/chicken-5.2.0/lib/chicken/11/exn-condition.so ... ; loading /Data/tools/chicken-5.2.0/lib/chicken/11/srfi-29-install.so ... Error: bad argument count - received 0 but expected 1: #<procedure (chicken.base#open-input-string string)> Call history: utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:144: char-downcase-single utf8-case-map.scm:50: utf8-lolevel#write-utf8-char utf8-case-map.scm:224: loop <syntax> (write "date is ~a~%" (format-date "~Y-~m-~d" (current-date))) <syntax> (format-date "~Y-~m-~d" (current-date)) <syntax> (current-date) <eval> (write "date is ~a~%" (format-date "~Y-~m-~d" (current-date))) <eval> (format-date "~Y-~m-~d" (current-date)) <eval> (current-date) <--
If instead I compile it with csc and run it, then I get:
% ./try Error: bad argument count - received 0 but expected 1: #<procedure (chicken.base#open-input-string string)> Call history: utf8-case-map.scm:222: utf8-lolevel#read-utf8-char utf8-case-map.scm:223: char-downcase-locale utf8-case-map.scm:215: char-downcase* utf8-case-map.scm:143: char-map-multi-case utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:117: loop utf8-case-map.scm:144: char-downcase-single utf8-case-map.scm:50: utf8-lolevel#write-utf8-char utf8-case-map.scm:224: loop try.scm:2: srfi-19-date#current-date try.scm:2: srfi-19-io#format-date <--
which seems to be clearly pointing towards the same thing.
I'm sure this used to work (maybe in 5.0.0), so this appears to be a regression.
Changes and comments
[2022-06-25 23:57:24 UTC] kon changed status from new to accepted
[2022-06-25 23:57:24 UTC] kon set owner to kon
[2022-06-26 00:00:48 UTC] kon changed status from accepted to closed
[2022-06-26 00:00:48 UTC] kon set resolution to worksforme
[2022-06-26 00:00:48 UTC] kon wrote:
#585 $ csi -n CHICKEN (c) 2008-2022, The CHICKEN Team (c) 2000-2007, Felix L. Winkelmann Version 5.3.1 (kinda-fixed) (rev 4ac147d8) macosx-unix-clang-x86-64 [[|64bit dload ptables ]]
Type ,? for help. #;1> (import srfi-19-date srfi-19-io) [[..blah...]|] #;2> (write (format-date "~Y-~m-~d" (current-date))) "2022-06-25"#;3>