From xemacs-m  Mon Jul  7 18:07:55 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id SAA09186
	for <xemacs-beta@xemacs.org>; Mon, 7 Jul 1997 18:07:53 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id BAA17921; Tue, 8 Jul 1997 01:07:55 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] Fstring_to_number
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 08 Jul 1997 01:07:54 +0200
Message-ID: <kig90zi1mwl.fsf@jagor.srce.hr>
Lines: 45
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta10) - "Athens"

Hmm...  I noticed that signals are continuable in XEmacs.  Yummy!  So
the Lispref is wrong, after all.

     Common Lisp note: XEmacs Lisp has nothing like the Common Lisp
     concept of continuable errors.


It also means that we should use `signal_simple_error' rather than
Fsignal -- unless we are ready to handle the continuation, of course.
But then I noticed that we have a check_int_range function.  Cool.
So, here is the patch that addresses all of the issues in
Fstring_to_number.

1997-07-08  Hrvoje Niksic  <hniksic@srce.hr>

	* data.c (Fstring_to_number): Use `check_int_range'.
	(Fstring_to_number): Would bug out on wrong type check.

--- src/data.c.orig	Tue Jul  8 00:57:44 1997
+++ src/data.c	Tue Jul  8 01:00:27 1997
@@ -1286,8 +1286,7 @@
     {
       CHECK_INT (base);
       b = XINT (base);
-      if (b < 2 || b > 16)
-	Fsignal (Qargs_out_of_range, Fcons (base, Qnil));
+      check_int_range (b, 2, 16);
     }
 
   p = (char *) XSTRING_DATA (string);
@@ -1302,7 +1301,7 @@
     return make_float (atof (p));
 #endif /* LISP_FLOAT_TYPE */
 
-  if (base == 10)
+  if (b == 10)
     {
       /* Use the system-provided functions for base 10. */
       Lisp_Object value;


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
I'm sure they'll listen to reason! -- Neal Stevenson, _Snow Crash_

