Changeset 5097


Ignore:
Timestamp:
12/12/03 16:15:42 (18 years ago)
Author:
piso
Message:

SIMPLE-CONDITION-FORMAT-CONTROL
SIMPLE-CONDITION-FORMAT-ARGUMENTS

File:
1 edited

Legend:

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

    r3981 r5097  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: SimpleCondition.java,v 1.6 2003-09-21 23:04:58 piso Exp $
     5 * $Id: SimpleCondition.java,v 1.7 2003-12-12 16:15:42 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626    public SimpleCondition()
    2727    {
     28        setFormatControl(NIL);
     29        setFormatArguments(NIL);
    2830    }
    2931
    30     public SimpleCondition(LispObject initArgs)
     32    public SimpleCondition(LispObject formatControl, LispObject formatArguments)
    3133    {
    32         this(); // FIXME
     34        setFormatControl(formatControl);
     35        setFormatArguments(formatArguments);
     36    }
     37
     38    public SimpleCondition(LispObject initArgs) throws ConditionThrowable
     39    {
     40        super(initArgs);
    3341    }
    3442
     
    5664        return super.typep(type);
    5765    }
     66
     67    // ### simple-condition-format-control
     68    private static final Primitive1 SIMPLE_CONDITION_FORMAT_CONTROL =
     69        new Primitive1("simple-condition-format-control", "condition")
     70    {
     71        public LispObject execute(LispObject arg) throws ConditionThrowable
     72        {
     73            if (arg instanceof Condition)
     74                return ((Condition)arg).getFormatControl();
     75            throw new ConditionThrowable(new TypeError(arg, Symbol.CONDITION));
     76        }
     77    };
     78
     79    // ### simple-condition-format-arguments
     80    private static final Primitive1 SIMPLE_CONDITION_FORMAT_ARGUMENTS =
     81        new Primitive1("simple-condition-format-arguments", "condition")
     82    {
     83        public LispObject execute(LispObject arg) throws ConditionThrowable
     84        {
     85            if (arg instanceof Condition)
     86                return ((Condition)arg).getFormatArguments();
     87            throw new ConditionThrowable(new TypeError(arg, Symbol.CONDITION));
     88        }
     89    };
    5890}
Note: See TracChangeset for help on using the changeset viewer.