Changeset 8480


Ignore:
Timestamp:
02/06/05 01:15:56 (17 years ago)
Author:
piso
Message:

makeRatio(): (read-from-string "1/0") => READER-ERROR, not DIVISION-BY-ZERO

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Stream.java

    r8479 r8480  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Stream.java,v 1.109 2005-02-06 00:55:08 piso Exp $
     5 * $Id: Stream.java,v 1.110 2005-02-06 01:15:56 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    888888            BigInteger denominator =
    889889                new BigInteger(token.substring(index + 1), radix);
     890            // Check the denominator here, before calling number(), so we can
     891            // signal a READER-ERROR, as required by ANSI, instead of DIVISION-
     892            // BY-ZERO.
     893            if (denominator.signum() == 0)
     894                signal(new ReaderError("Division by zero."));
    890895            return number(numerator, denominator);
    891896        }
    892         catch (NumberFormatException e) {}
    893         return null;
     897        catch (NumberFormatException e) {
     898            return null;
     899        }
    894900    }
    895901
Note: See TracChangeset for help on using the changeset viewer.