[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #28022] case-lambda (srfi 16) not working with strings
From: |
Andrea Girotto |
Subject: |
[Bug-kawa] [bug #28022] case-lambda (srfi 16) not working with strings |
Date: |
Sun, 15 Nov 2009 09:18:15 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 |
URL:
<http://savannah.gnu.org/bugs/?28022>
Summary: case-lambda (srfi 16) not working with strings
Project: Kawa
Submitted by: andreag
Submitted on: Sun 15 Nov 2009 09:18:14 AM GMT
Category: Scheme library
Severity: 3 - Normal
Item Group: Unexpected result
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
"case-lambda" works correctly with numbers a arguments but fails if arguments
are strings. See the testsuite attached: with the current case-lambda
implementation ("Kawa 1.9.90 (revision 6301:6308)" and "Kawa 1.9.90 (revision
6451)") the last tests fail.
I redefined it this way (seems to work, at least successfully completes the
testsuite and it is enough for my application):
(define-syntax case-lambda
(syntax-rules (values: definition:)
((case-lambda)
(lambda values
(syntax-error "case-lambda without any clauses") ) )
((case-lambda (arg0 exp0 ...) cla1 ...)
(lambda values
(case-lambda values: values (length values) definition: (arg0 exp0
...) cla1 ...) ) )
((case-lambda values: values val-len definition: ((arg0 ...) exp0 ...)
cla1 ...)
(if (= val-len (length '(arg0 ...)))
(apply (lambda (arg0 ...) exp0 ...) values)
(case-lambda values: values val-len definition: cla1 ...) ) )
((case-lambda values: values val-len definition (arg0 exp0 ...) cla1
...)
(let ((arg0 values))
exp0 ... ) )
((case-lambda values: values val-len definition:)
(syntax-error "wrong number of arguments to case-lambda") )
((case-lambda all ...)
(syntax-error "invalid case-lambda syntax") )
) )
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 15 Nov 2009 09:18:14 AM GMT Name: srfi-16-test.log Size: 907B
By: andreag
Test suite and log for srfi-16
<http://savannah.gnu.org/bugs/download.php?file_id=19057>
-------------------------------------------------------
Date: Sun 15 Nov 2009 09:18:14 AM GMT Name: srfi-16-test.scm Size: 932B
By: andreag
Test suite and log for srfi-16
<http://savannah.gnu.org/bugs/download.php?file_id=19056>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?28022>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-kawa] [bug #28022] case-lambda (srfi 16) not working with strings,
Andrea Girotto <=