Changeset 10304


Ignore:
Timestamp:
11/01/05 01:42:26 (16 years ago)
Author:
piso
Message:

Work in progress (tested).

Location:
trunk/j/src/org/armedbear/lisp
Files:
16 edited

Legend:

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

    r9489 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: ArithmeticError.java,v 1.14 2005-06-22 17:47:50 piso Exp $
     5 * $Id: ArithmeticError.java,v 1.15 2005-11-01 01:40:14 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class ArithmeticError extends LispError
    2525{
    26     protected ArithmeticError(LispClass cls)
     26    protected ArithmeticError(LispClass cls) throws ConditionThrowable
    2727    {
    2828        super(cls);
  • trunk/j/src/org/armedbear/lisp/CellError.java

    r10202 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: CellError.java,v 1.7 2005-10-23 16:39:48 piso Exp $
     5 * $Id: CellError.java,v 1.8 2005-11-01 01:41:09 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class CellError extends LispError
    2525{
    26     protected CellError(LispClass cls)
     26    protected CellError(LispClass cls) throws ConditionThrowable
    2727    {
    2828        super(cls);
  • trunk/j/src/org/armedbear/lisp/Condition.java

    r10210 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Condition.java,v 1.43 2005-10-23 18:44:50 piso Exp $
     5 * $Id: Condition.java,v 1.44 2005-11-01 01:32:45 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626    protected String message = null;
    2727
    28     public Condition()
     28    public Condition() throws ConditionThrowable
    2929    {
    3030        super(StandardClass.CONDITION);
    3131        Debug.assertTrue(slots.length == 2);
    32         slots[0] = NIL;
    33         slots[1] = NIL;
     32        setFormatArguments(NIL);
    3433        message = null;
    3534    }
    3635
    37     protected Condition(LispClass cls)
     36    protected Condition(LispClass cls) throws ConditionThrowable
    3837    {
    3938        super(cls);
    4039        Debug.assertTrue(slots.length >= 2);
    41         slots[0] = NIL;
    42         slots[1] = NIL;
     40        setFormatArguments(NIL);
    4341        message = null;
    4442    }
     
    4745    {
    4846        super(cls, length);
    49 //         super(cls);
    50 //         Debug.assertTrue(length == cls.getLayoutLength());
    5147        message = null;
    5248    }
     
    6157    protected void initialize(LispObject initArgs) throws ConditionThrowable
    6258    {
    63         LispObject control = NIL;
    64         LispObject arguments = NIL;
     59        LispObject control = null;
     60        LispObject arguments = null;
    6561        LispObject first, second;
    6662        while (initArgs instanceof Cons) {
     
    6965            second = initArgs.car();
    7066            initArgs = initArgs.cdr();
    71             if (first == Keyword.FORMAT_CONTROL)
    72                 control = second;
    73             else if (first == Keyword.FORMAT_ARGUMENTS)
    74                 arguments = second;
    75         }
    76         setFormatControl(control);
     67            if (first == Keyword.FORMAT_CONTROL) {
     68                if (control == null)
     69                    control = second;
     70            } else if (first == Keyword.FORMAT_ARGUMENTS) {
     71                if (arguments == null)
     72                    arguments = second;
     73            }
     74        }
     75        if (control != null)
     76            setFormatControl(control);
     77        if (arguments == null)
     78            arguments = NIL;
    7779        setFormatArguments(arguments);
    7880    }
  • trunk/j/src/org/armedbear/lisp/ConditionThrowable.java

    r5078 r10304  
    22 * ConditionThrowable.java
    33 *
    4  * Copyright (C) 2003 Peter Graves
    5  * $Id: ConditionThrowable.java,v 1.7 2003-12-12 01:09:24 piso Exp $
     4 * Copyright (C) 2003-2005 Peter Graves
     5 * $Id: ConditionThrowable.java,v 1.8 2005-11-01 01:34:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4040    }
    4141
    42     public LispObject getCondition()
     42    public LispObject getCondition() throws ConditionThrowable
    4343    {
    4444        return condition != null ? condition : new Condition();
  • trunk/j/src/org/armedbear/lisp/Go.java

    r9497 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Go.java,v 1.5 2005-06-22 23:32:12 piso Exp $
     5 * $Id: Go.java,v 1.6 2005-11-01 01:36:44 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3636    }
    3737
    38     public LispObject getCondition()
     38    public LispObject getCondition() throws ConditionThrowable
    3939    {
    4040        try {
  • trunk/j/src/org/armedbear/lisp/LispError.java

    r9484 r10304  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: LispError.java,v 1.14 2005-06-22 14:00:13 piso Exp $
     5 * $Id: LispError.java,v 1.15 2005-11-01 01:42:06 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class LispError extends SeriousCondition
    2525{
    26     public LispError()
     26    public LispError() throws ConditionThrowable
    2727    {
    2828    }
    2929
    30     protected LispError(LispClass cls)
     30    protected LispError(LispClass cls) throws ConditionThrowable
    3131    {
    3232        super(cls);
  • trunk/j/src/org/armedbear/lisp/ProgramError.java

    r9493 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: ProgramError.java,v 1.14 2005-06-22 18:21:08 piso Exp $
     5 * $Id: ProgramError.java,v 1.15 2005-11-01 01:40:41 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class ProgramError extends LispError
    2525{
    26     protected ProgramError(LispClass cls)
     26    protected ProgramError(LispClass cls) throws ConditionThrowable
    2727    {
    2828        super(cls);
  • trunk/j/src/org/armedbear/lisp/Return.java

    r9497 r10304  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: Return.java,v 1.10 2005-06-22 23:32:06 piso Exp $
     5 * $Id: Return.java,v 1.11 2005-11-01 01:35:40 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5757    }
    5858
    59     public LispObject getCondition()
     59    public LispObject getCondition() throws ConditionThrowable
    6060    {
    6161        try {
    62             StringBuffer sb = new StringBuffer("No block named ");
     62            FastStringBuffer sb = new FastStringBuffer("No block named ");
    6363            sb.append(tag.writeToString());
    6464            sb.append(" is currently visible.");
  • trunk/j/src/org/armedbear/lisp/SeriousCondition.java

    r9484 r10304  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: SeriousCondition.java,v 1.5 2005-06-22 13:59:39 piso Exp $
     5 * $Id: SeriousCondition.java,v 1.6 2005-11-01 01:42:26 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class SeriousCondition extends Condition
    2525{
    26     public SeriousCondition()
     26    public SeriousCondition() throws ConditionThrowable
    2727    {
    2828    }
    2929
    30     protected SeriousCondition(LispClass cls)
     30    protected SeriousCondition(LispClass cls) throws ConditionThrowable
    3131    {
    3232        super(cls);
  • trunk/j/src/org/armedbear/lisp/StandardClass.java

    r10262 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: StandardClass.java,v 1.39 2005-10-28 16:38:09 piso Exp $
     5 * $Id: StandardClass.java,v 1.40 2005-11-01 01:34:42 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    242242        CONDITION.setDirectSlotDefinitions(
    243243            list2(new SlotDefinition(Symbol.FORMAT_CONTROL,
    244                                      list1(PACKAGE_CL.intern("SIMPLE-CONDITION-FORMAT-CONTROL"))),
     244                                     list1(Symbol.SIMPLE_CONDITION_FORMAT_CONTROL)),
    245245                  new SlotDefinition(Symbol.FORMAT_ARGUMENTS,
    246                                      list1(PACKAGE_CL.intern("SIMPLE-CONDITION-FORMAT-ARGUMENTS")))));
     246                                     list1(Symbol.SIMPLE_CONDITION_FORMAT_ARGUMENTS),
     247                                     NIL)));
    247248        CONTROL_ERROR.setCPL(CONTROL_ERROR, ERROR, SERIOUS_CONDITION, CONDITION,
    248249                             STANDARD_OBJECT, BuiltInClass.CLASS_T);
  • trunk/j/src/org/armedbear/lisp/StorageCondition.java

    r9482 r10304  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: StorageCondition.java,v 1.3 2005-06-21 18:42:15 piso Exp $
     5 * $Id: StorageCondition.java,v 1.4 2005-11-01 01:41:42 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class StorageCondition extends SeriousCondition
    2525{
    26     public StorageCondition()
     26    public StorageCondition() throws ConditionThrowable
    2727    {
    2828    }
  • trunk/j/src/org/armedbear/lisp/StreamError.java

    r10108 r10304  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: StreamError.java,v 1.21 2005-10-15 16:01:31 piso Exp $
     5 * $Id: StreamError.java,v 1.22 2005-11-01 01:39:45 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626    private final Throwable cause;
    2727
    28     protected StreamError(LispClass cls)
     28    protected StreamError(LispClass cls) throws ConditionThrowable
    2929    {
    3030        super(cls);
  • trunk/j/src/org/armedbear/lisp/Throw.java

    r9497 r10304  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: Throw.java,v 1.13 2005-06-22 23:32:20 piso Exp $
     5 * $Id: Throw.java,v 1.14 2005-11-01 01:37:47 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4242    }
    4343
    44     public LispObject getCondition()
     44    public LispObject getCondition() throws ConditionThrowable
    4545    {
    4646        try {
  • trunk/j/src/org/armedbear/lisp/TypeError.java

    r10296 r10304  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: TypeError.java,v 1.32 2005-10-31 12:25:43 piso Exp $
     5 * $Id: TypeError.java,v 1.33 2005-11-01 01:35:13 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2929    {
    3030        super(StandardClass.TYPE_ERROR);
    31         setDatum(NIL);
    32         setExpectedType(NIL);
    33     }
    34 
    35     protected TypeError(LispClass cls)
     31    }
     32
     33    protected TypeError(LispClass cls) throws ConditionThrowable
    3634    {
    3735        super(cls);
     
    5553    {
    5654        super.initialize(initArgs);
    57         LispObject datum = NIL;
    58         LispObject expectedType = NIL;
     55        LispObject datum = null;
     56        LispObject expectedType = null;
    5957        LispObject first, second;
    6058        while (initArgs != NIL) {
     
    6361            second = initArgs.car();
    6462            initArgs = initArgs.cdr();
    65             if (first == Keyword.DATUM)
    66                 datum = second;
    67             else if (first == Keyword.EXPECTED_TYPE)
    68                 expectedType = second;
    69         }
    70         setDatum(datum);
    71         setExpectedType(expectedType);
    72         this.typeString = expectedType.writeToString();
     63            if (first == Keyword.DATUM) {
     64                if (datum == null)
     65                    datum = second;
     66            } else if (first == Keyword.EXPECTED_TYPE) {
     67                if (expectedType == null)
     68                    expectedType = second;
     69            }
     70        }
     71        if (datum != null)
     72            setDatum(datum);
     73        if (expectedType != null) {
     74            setExpectedType(expectedType);
     75            this.typeString = expectedType.writeToString();
     76        }
    7377    }
    7478
  • trunk/j/src/org/armedbear/lisp/Warning.java

    r9482 r10304  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Warning.java,v 1.4 2005-06-21 18:42:15 piso Exp $
     5 * $Id: Warning.java,v 1.5 2005-11-01 01:37:17 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public class Warning extends Condition
    2525{
    26     protected Warning()
     26    protected Warning() throws ConditionThrowable
    2727    {
    2828    }
  • trunk/j/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java

    r9493 r10304  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: WrongNumberOfArgumentsException.java,v 1.9 2005-06-22 18:20:50 piso Exp $
     5 * $Id: WrongNumberOfArgumentsException.java,v 1.10 2005-11-01 01:38:58 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2727
    2828    public WrongNumberOfArgumentsException(Operator operator)
     29        throws ConditionThrowable
    2930    {
    3031        // This is really just an ordinary PROGRAM-ERROR, broken out into its
     
    3637    public String getMessage()
    3738    {
    38         StringBuffer sb = new StringBuffer("Wrong number of arguments");
     39        FastStringBuffer sb =
     40            new FastStringBuffer("Wrong number of arguments");
    3941        LispObject lambdaName = operator.getLambdaName();
    4042        if (lambdaName != null && lambdaName != NIL) {
Note: See TracChangeset for help on using the changeset viewer.