Changeset 10327


Ignore:
Timestamp:
11/03/05 14:41:46 (16 years ago)
Author:
piso
Message:

Work in progress (tested).

File:
1 edited

Legend:

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

    r10210 r10327  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: RandomState.java,v 1.6 2005-10-23 18:44:50 piso Exp $
     5 * $Id: RandomState.java,v 1.7 2005-11-03 14:41:46 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    7777    }
    7878
    79     public String writeToString()
     79    public String writeToString() throws ConditionThrowable
    8080    {
    81         return unreadableString("RANDOM-STATE");
     81        return unreadableString(Symbol.RANDOM_STATE);
    8282    }
    8383
     
    111111            }
    112112        }
    113         return signal(new TypeError(arg, "positive integer or positive float"));
     113        return signalTypeError(arg, list3(Symbol.OR,
     114                                          list2(Symbol.INTEGER, Fixnum.ONE),
     115                                          list2(Symbol.FLOAT, list1(Fixnum.ZERO))));
    114116    }
    115117
    116118    // ### random limit &optional random-state => random-number
    117119    private static final Primitive RANDOM =
    118         new Primitive("random", "limit &optional random-state")
     120        new Primitive(Symbol.RANDOM, "limit &optional random-state")
    119121    {
    120122        public LispObject execute(LispObject arg) throws ConditionThrowable
     
    135137    };
    136138
    137     // ### make-random-state
    138     // make-random-state &optional state
     139    // ### make-random-state &optional state
    139140    private static final Primitive MAKE_RANDOM_STATE =
    140         new Primitive("make-random-state", "&optional state") {
     141        new Primitive(Symbol.MAKE_RANDOM_STATE, "&optional state")
     142    {
    141143        public LispObject execute() throws ConditionThrowable
    142144        {
     
    158160    // ### random-state-p
    159161    private static final Primitive RANDOM_STATE_P =
    160         new Primitive("random-state-p", "object")
     162        new Primitive(Symbol.RANDOM_STATE_P, "object")
    161163    {
    162164        public LispObject execute(LispObject arg)
Note: See TracChangeset for help on using the changeset viewer.