Changeset 10209


Ignore:
Timestamp:
10/23/05 18:11:10 (16 years ago)
Author:
piso
Message:

Symbol refactoring (work in progress).

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

Legend:

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

    r10202 r10209  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: AbstractArray.java,v 1.45 2005-10-23 16:39:48 piso Exp $
     5 * $Id: AbstractArray.java,v 1.46 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    221221    {
    222222        if (dimensions.length == 0) {
    223             if (_PRINT_CIRCLE_.symbolValue(thread) != NIL) {
     223            if (Symbol.PRINT_CIRCLE.symbolValue(thread) != NIL) {
    224224                StringOutputStream stream = new StringOutputStream();
    225225                thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(),
  • trunk/j/src/org/armedbear/lisp/Bignum.java

    r10204 r10209  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Bignum.java,v 1.74 2005-10-23 17:17:00 piso Exp $
     5 * $Id: Bignum.java,v 1.75 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    614614    {
    615615        final LispThread thread = LispThread.currentThread();
    616         final int base = Fixnum.getValue(_PRINT_BASE_.symbolValue(thread));
     616        final int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));
    617617        String s = value.toString(base).toUpperCase();
    618618        if (Symbol.PRINT_RADIX.symbolValue(thread) != NIL) {
  • trunk/j/src/org/armedbear/lisp/FaslReader.java

    r10206 r10209  
    33 *
    44 * Copyright (C) 2005 Peter Graves
    5  * $Id: FaslReader.java,v 1.8 2005-10-23 17:38:10 piso Exp $
     5 * $Id: FaslReader.java,v 1.9 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    243243        {
    244244            final LispThread thread = LispThread.currentThread();
    245             if (_READ_EVAL_.symbolValue(thread) == NIL)
     245            if (Symbol.READ_EVAL.symbolValue(thread) == NIL)
    246246                return signal(new ReaderError("Can't read #. when *READ-EVAL* is NIL.",
    247247                                              stream));
  • trunk/j/src/org/armedbear/lisp/Fixnum.java

    r10204 r10209  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: Fixnum.java,v 1.128 2005-10-23 17:17:00 piso Exp $
     5 * $Id: Fixnum.java,v 1.129 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    809809    {
    810810        final LispThread thread = LispThread.currentThread();
    811         int base = Fixnum.getValue(_PRINT_BASE_.symbolValue(thread));
     811        int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));
    812812        String s = Integer.toString(value, base).toUpperCase();
    813813        if (Symbol.PRINT_RADIX.symbolValue(thread) != NIL) {
  • trunk/j/src/org/armedbear/lisp/Lisp.java

    r10208 r10209  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: Lisp.java,v 1.409 2005-10-23 17:51:56 piso Exp $
     5 * $Id: Lisp.java,v 1.410 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    217217                            expander.incrementCallCount();
    218218                    LispObject hook =
    219                         coerceToFunction(_MACROEXPAND_HOOK_.symbolValue(thread));
     219                        coerceToFunction(Symbol.MACROEXPAND_HOOK.symbolValue(thread));
    220220                    return thread.setValues(hook.execute(expander, form, env),
    221221                                            T);
     
    16241624                            thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    16251625                            thread.bindSpecial(Symbol.PRINT_RADIX, NIL);
    1626                             thread.bindSpecial(_PRINT_BASE_, new Fixnum(10));
     1626                            thread.bindSpecial(Symbol.PRINT_BASE, new Fixnum(10));
    16271627                            sb.append(obj.writeToString());
    16281628                            thread.lastSpecialBinding = lastSpecialBinding;
     
    16341634                            thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
    16351635                            thread.bindSpecial(Symbol.PRINT_RADIX, NIL);
    1636                             thread.bindSpecial(_PRINT_BASE_, new Fixnum(16));
     1636                            thread.bindSpecial(Symbol.PRINT_BASE, new Fixnum(16));
    16371637                            sb.append(obj.writeToString());
    16381638                            thread.lastSpecialBinding = lastSpecialBinding;
     
    18361836    }
    18371837
    1838     // ### *read-eval*
    1839     public static final Symbol _READ_EVAL_ =
    1840         exportSpecial("*READ-EVAL*", PACKAGE_CL, T);
     1838    static {
     1839        Symbol.READ_EVAL.initializeSpecial(T);
     1840    }
    18411841
    18421842    // ### *features*
    1843 //     public static final Symbol Symbol.FEATURES =
    1844 //         exportSpecial("*FEATURES*", PACKAGE_CL, null);
    18451843    static {
    18461844        Symbol.FEATURES.initializeSpecial(NIL);
     
    18981896    }
    18991897
    1900     // ### *modules*
    1901     public static final Symbol _MODULES_ =
    1902         exportSpecial("*MODULES*", PACKAGE_CL, NIL);
     1898    static {
     1899        Symbol.MODULES.initializeSpecial(NIL);
     1900    }
    19031901
    19041902    static {
    19051903        Symbol.LOAD_VERBOSE.initializeSpecial(NIL);
    19061904        Symbol.LOAD_PRINT.initializeSpecial(NIL);
    1907     }
    1908 
    1909 //     // ### *load-pathname*
    1910 //     public static final Symbol LOAD_PATHNAME =
    1911 //         exportSpecial("*LOAD-PATHNAME*", PACKAGE_CL, NIL);
    1912     static {
    19131905        Symbol.LOAD_PATHNAME.initializeSpecial(NIL);
    1914     }
    1915 
    1916 //     // ### *load-truename*
    1917 //     public static final Symbol LOAD_TRUENAME =
    1918 //         exportSpecial("*LOAD-TRUENAME*", PACKAGE_CL, NIL);
    1919     static {
    19201906        Symbol.LOAD_TRUENAME.initializeSpecial(NIL);
     1907        Symbol.COMPILE_VERBOSE.initializeSpecial(T);
     1908        Symbol.COMPILE_PRINT.initializeSpecial(T);
     1909        Symbol._COMPILE_FILE_PATHNAME_.initializeSpecial(NIL);
     1910        Symbol.COMPILE_FILE_TRUENAME.initializeSpecial(NIL);
    19211911    }
    19221912
     
    19451935    public static final Symbol _AUTOLOAD_VERBOSE_ =
    19461936        exportSpecial("*AUTOLOAD-VERBOSE*", PACKAGE_EXT, NIL);
    1947 
    1948     // ### *compile-verbose*
    1949     public static final Symbol _COMPILE_VERBOSE_ =
    1950         exportSpecial("*COMPILE-VERBOSE*", PACKAGE_CL, T);
    1951 
    1952     // ### *compile-print*
    1953     public static final Symbol _COMPILE_PRINT_ =
    1954         exportSpecial("*COMPILE-PRINT*", PACKAGE_CL, T);
    1955 
    1956     // ### *compile-file-pathname*
    1957     public static final Symbol _COMPILE_FILE_PATHNAME_ =
    1958         exportSpecial("*COMPILE-FILE-PATHNAME*", PACKAGE_CL, NIL);
    1959 
    1960     // ### *compile-file-truename*
    1961     public static final Symbol _COMPILE_FILE_TRUENAME_ =
    1962         exportSpecial("*COMPILE-FILE-TRUENAME*", PACKAGE_CL, NIL);
    19631937
    19641938    // ### *compile-file-type*
     
    19731947
    19741948    // ### *macroexpand-hook*
    1975     public static final Symbol _MACROEXPAND_HOOK_ =
    1976         exportSpecial("*MACROEXPAND-HOOK*", PACKAGE_CL, Symbol.FUNCALL);
     1949//     public static final Symbol _MACROEXPAND_HOOK_ =
     1950//         exportSpecial("*MACROEXPAND-HOOK*", PACKAGE_CL, Symbol.FUNCALL);
     1951    static {
     1952        Symbol.MACROEXPAND_HOOK.initializeSpecial(Symbol.FUNCALL);
     1953    }
    19771954
    19781955    // ### array-dimension-limit
     
    20001977        exportSpecial("*PRINT-ARRAY*", PACKAGE_CL, T);
    20011978
    2002     public static final Symbol _PRINT_BASE_ =
    2003         exportSpecial("*PRINT-BASE*", PACKAGE_CL, new Fixnum(10));
    2004 
    2005     public static final Symbol _PRINT_CASE_ =
    2006         exportSpecial("*PRINT-CASE*", PACKAGE_CL, Keyword.UPCASE);
    2007 
    2008     public static final Symbol _PRINT_CIRCLE_ =
    2009         exportSpecial("*PRINT-CIRCLE*", PACKAGE_CL, NIL);
     1979//     public static final Symbol PRINT_BASE =
     1980//         exportSpecial("*PRINT-BASE*", PACKAGE_CL, new Fixnum(10));
     1981    static {
     1982        Symbol.PRINT_BASE.initializeSpecial(new Fixnum(10));
     1983    }
     1984
     1985//     public static final Symbol _PRINT_CASE_ =
     1986//         exportSpecial("*PRINT-CASE*", PACKAGE_CL, Keyword.UPCASE);
     1987    static {
     1988        Symbol.PRINT_CASE.initializeSpecial(Keyword.UPCASE);
     1989    }
     1990
     1991//     public static final Symbol PRINT_CIRCLE =
     1992//         exportSpecial("*PRINT-CIRCLE*", PACKAGE_CL, NIL);
     1993    static {
     1994        Symbol.PRINT_CIRCLE.initializeSpecial(NIL);
     1995    }
    20101996
    20111997    static {
  • trunk/j/src/org/armedbear/lisp/LispReader.java

    r10206 r10209  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LispReader.java,v 1.44 2005-10-23 17:38:10 piso Exp $
     5 * $Id: LispReader.java,v 1.45 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    243243        {
    244244            final LispThread thread = LispThread.currentThread();
    245             if (_READ_EVAL_.symbolValue(thread) == NIL)
     245            if (Symbol.READ_EVAL.symbolValue(thread) == NIL)
    246246                return signal(new ReaderError("Can't read #. when *READ-EVAL* is NIL.",
    247247                                              stream));
  • trunk/j/src/org/armedbear/lisp/LogicalPathname.java

    r10202 r10209  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LogicalPathname.java,v 1.21 2005-10-23 16:39:49 piso Exp $
     5 * $Id: LogicalPathname.java,v 1.22 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    245245        if (version.integerp()) {
    246246            sb.append('.');
    247             int base = Fixnum.getValue(_PRINT_BASE_.symbolValue(thread));
     247            int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));
    248248            if (version instanceof Fixnum)
    249249                sb.append(Integer.toString(((Fixnum)version).value, base).toUpperCase());
  • trunk/j/src/org/armedbear/lisp/Pathname.java

    r10202 r10209  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Pathname.java,v 1.108 2005-10-23 16:39:49 piso Exp $
     5 * $Id: Pathname.java,v 1.109 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    305305            if (version.integerp()) {
    306306                sb.append('.');
    307                 int base = Fixnum.getValue(_PRINT_BASE_.symbolValue());
     307                int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue());
    308308                if (version instanceof Fixnum)
    309309                    sb.append(Integer.toString(((Fixnum)version).value, base).toUpperCase());
  • trunk/j/src/org/armedbear/lisp/Ratio.java

    r10204 r10209  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: Ratio.java,v 1.51 2005-10-23 17:17:00 piso Exp $
     5 * $Id: Ratio.java,v 1.52 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    509509    {
    510510        final LispThread thread = LispThread.currentThread();
    511         int base = Fixnum.getValue(_PRINT_BASE_.symbolValue(thread));
     511        int base = Fixnum.getValue(Symbol.PRINT_BASE.symbolValue(thread));
    512512        StringBuffer sb = new StringBuffer(numerator.toString(base));
    513513        sb.append('/');
  • trunk/j/src/org/armedbear/lisp/StructureObject.java

    r9764 r10209  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: StructureObject.java,v 1.53 2005-08-01 16:43:51 piso Exp $
     5 * $Id: StructureObject.java,v 1.54 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    179179                    limit = slots.length;
    180180                final boolean printCircle =
    181                     _PRINT_CIRCLE_.symbolValue(thread) != NIL;
     181                    (Symbol.PRINT_CIRCLE.symbolValue(thread) != NIL);
    182182                for (int i = 0; i < limit; i++) {
    183183                    sb.append(' ');
  • trunk/j/src/org/armedbear/lisp/Symbol.java

    r10208 r10209  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: Symbol.java,v 1.221 2005-10-23 17:51:56 piso Exp $
     5 * $Id: Symbol.java,v 1.222 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    377377        final LispThread thread = LispThread.currentThread();
    378378        boolean printEscape = (PRINT_ESCAPE.symbolValue(thread) != NIL);
    379         LispObject printCase = _PRINT_CASE_.symbolValue(thread);
     379        LispObject printCase = PRINT_CASE.symbolValue(thread);
    380380        final LispObject readtableCase =
    381381            ((Readtable)_READTABLE_.symbolValue(thread)).getReadtableCase();
     
    546546        int radix;
    547547        try {
    548             radix = ((Fixnum)_PRINT_BASE_.symbolValue(thread)).value;
     548            radix = ((Fixnum)PRINT_BASE.symbolValue(thread)).value;
    549549        }
    550550        catch (ClassCastException e) {
     
    814814    public static final Symbol _COMPILE_FILE_PATHNAME_ =
    815815        PACKAGE_CL.addExternalSymbol("*COMPILE-FILE-PATHNAME*");
    816     public static final Symbol _COMPILE_FILE_TRUENAME_ =
     816    public static final Symbol COMPILE_FILE_TRUENAME =
    817817        PACKAGE_CL.addExternalSymbol("*COMPILE-FILE-TRUENAME*");
    818     public static final Symbol _COMPILE_PRINT_ =
     818    public static final Symbol COMPILE_PRINT =
    819819        PACKAGE_CL.addExternalSymbol("*COMPILE-PRINT*");
    820     public static final Symbol _COMPILE_VERBOSE_ =
     820    public static final Symbol COMPILE_VERBOSE =
    821821        PACKAGE_CL.addExternalSymbol("*COMPILE-VERBOSE*");
    822822    public static final Symbol DEBUG_IO =
     
    840840    public static final Symbol LOAD_VERBOSE =
    841841        PACKAGE_CL.addExternalSymbol("*LOAD-VERBOSE*");
    842     public static final Symbol _MACROEXPAND_HOOK_ =
     842    public static final Symbol MACROEXPAND_HOOK =
    843843        PACKAGE_CL.addExternalSymbol("*MACROEXPAND-HOOK*");
    844     public static final Symbol _MODULES_ =
     844    public static final Symbol MODULES =
    845845        PACKAGE_CL.addExternalSymbol("*MODULES*");
    846846    public static final Symbol _PACKAGE_ =
     
    848848    public static final Symbol PRINT_ARRAY =
    849849        PACKAGE_CL.addExternalSymbol("*PRINT-ARRAY*");
    850     public static final Symbol _PRINT_BASE_ =
     850    public static final Symbol PRINT_BASE =
    851851        PACKAGE_CL.addExternalSymbol("*PRINT-BASE*");
    852852    public static final Symbol PRINT_CASE =
    853853        PACKAGE_CL.addExternalSymbol("*PRINT-CASE*");
    854     public static final Symbol _PRINT_CIRCLE_ =
     854    public static final Symbol PRINT_CIRCLE =
    855855        PACKAGE_CL.addExternalSymbol("*PRINT-CIRCLE*");
    856856    public static final Symbol PRINT_ESCAPE =
     
    884884    public static final Symbol _READ_DEFAULT_FLOAT_FORMAT_ =
    885885        PACKAGE_CL.addExternalSymbol("*READ-DEFAULT-FLOAT-FORMAT*");
    886     public static final Symbol _READ_EVAL_ =
     886    public static final Symbol READ_EVAL =
    887887        PACKAGE_CL.addExternalSymbol("*READ-EVAL*");
    888888    public static final Symbol READ_SUPPRESS =
  • trunk/j/src/org/armedbear/lisp/ZeroRankArray.java

    r10202 r10209  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: ZeroRankArray.java,v 1.12 2005-10-23 16:39:49 piso Exp $
     5 * $Id: ZeroRankArray.java,v 1.13 2005-10-23 18:11:10 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    122122        if (printReadably || _PRINT_ARRAY_.symbolValue(thread) != NIL) {
    123123            StringBuffer sb = new StringBuffer("#0A");
    124             if (data == this && _PRINT_CIRCLE_.symbolValue(thread) != NIL) {
     124            if (data == this && Symbol.PRINT_CIRCLE.symbolValue(thread) != NIL) {
    125125                StringOutputStream stream = new StringOutputStream();
    126126                thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(),
Note: See TracChangeset for help on using the changeset viewer.