Here is a patch that fixes error reporting for (floor 1 (complex 1 1)).
>From d0c21c79ca0fdfbd81772463e9576a44c1b6eed6 Mon Sep 17 00:00:00 2001
From: Philipp Marek <philipp.ma...@linbit.com>
Date: Sun, 7 Aug 2011 15:10:39 +0200
Subject: [PATCH] 2nd argument of (floor) must be a REAL_TYPE, too.
Make the check match the error message. Tested via
$ ecl -norc -eval '(print (floor 2 (complex 1 1)))' -eval '(quit)'
#\Nul
Found by LLVM's "scan-build".
---
src/c/num_co.d | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git src/c/num_co.d src/c/num_co.d
index dd97ac6..b8996b0 100644
--- src/c/num_co.d
+++ src/c/num_co.d
@@ -176,7 +176,7 @@ ecl_floor2(cl_object x, cl_object y)
cl_object v0, v1;
cl_type ty;
ty = type_of(y);
- if (ecl_unlikely(!ECL_NUMBER_TYPE_P(ty))) {
+ if (ecl_unlikely(!REAL_TYPE(ty))) {
FEwrong_type_nth_arg(@[floor],2,y,@[real]);
}
switch(type_of(x)) {
--
1.7.5.4
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list