Changeset 4826


Ignore:
Timestamp:
11/18/03 14:11:19 (18 years ago)
Author:
piso
Message:

lastBinding => vars
lastFunctionalBinding => functions

File:
1 edited

Legend:

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

    r3883 r4826  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Environment.java,v 1.6 2003-09-19 01:46:40 piso Exp $
     5 * $Id: Environment.java,v 1.7 2003-11-18 14:11:19 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2424public final class Environment extends LispObject
    2525{
    26     private Binding lastBinding;
    27     private Binding lastFunctionalBinding;
    28 
     26    private Binding vars;
     27    private Binding functions;
    2928    private Binding blocks;
    3029
     
    3433    {
    3534        if (parent != null) {
    36             this.lastBinding = parent.lastBinding;
    37             this.lastFunctionalBinding = parent.lastFunctionalBinding;
     35            this.vars = parent.vars;
     36            this.functions = parent.functions;
    3837            this.blocks = parent.blocks;
    3938        }
     
    4241    public boolean isEmpty()
    4342    {
    44         return (lastBinding == null && lastFunctionalBinding == null);
     43        return (vars == null && functions == null);
    4544    }
    4645
    4746    public void bind(Symbol symbol, LispObject value)
    4847    {
    49         lastBinding = new Binding(symbol, value, lastBinding);
     48        vars = new Binding(symbol, value, vars);
    5049    }
    5150
     
    5857    public LispObject lookup(LispObject symbol)
    5958    {
    60         Binding binding = lastBinding;
     59        Binding binding = vars;
    6160        while (binding != null) {
    6261            if (binding.symbol == symbol)
     
    6968    public Binding getBinding(LispObject symbol)
    7069    {
    71         Binding binding = lastBinding;
     70        Binding binding = vars;
    7271        while (binding != null) {
    7372            if (binding.symbol == symbol)
     
    8180    public void bindFunctional(Symbol symbol, LispObject value)
    8281    {
    83         lastFunctionalBinding =
    84             new Binding(symbol, value, lastFunctionalBinding);
     82        functions = new Binding(symbol, value, functions);
    8583    }
    8684
    87     public LispObject lookupFunctional(LispObject symbol) throws ConditionThrowable
     85    public LispObject lookupFunctional(LispObject symbol)
     86        throws ConditionThrowable
    8887    {
    89         Binding binding = lastFunctionalBinding;
     88        Binding binding = functions;
    9089        while (binding != null) {
    9190            if (binding.symbol == symbol)
     
    117116        StringBuffer sb = new StringBuffer();
    118117        sb.append("#<ENVIRONMENT");
    119         Binding binding = lastBinding;
     118        Binding binding = vars;
    120119        while (binding != null) {
    121120            sb.append(' ');
Note: See TracChangeset for help on using the changeset viewer.