﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1791	format-date reports bad argument count	Norman Gray	Kon Lovett	"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."	defect	closed	major	someday	unknown	5.2.0	worksforme			
