Changeset 4010
- Timestamp:
- 09/23/03 12:42:27 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Primitives.java
r4004 r4010 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.42 4 2003-09-22 17:21:41piso Exp $5 * $Id: Primitives.java,v 1.425 2003-09-23 12:42:27 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 1575 1575 LispObject body = args.cdr(); 1576 1576 final int depth = thread.getStackDepth(); 1577 // Look for tags. 1578 Binding tags = null; 1579 LispObject remaining = args; 1580 while (remaining != NIL) { 1581 LispObject current = remaining.car(); 1582 remaining = remaining.cdr(); 1583 if (current instanceof Cons) 1584 continue; 1585 // It's a tag. 1586 tags = new Binding(current, remaining, tags); 1587 } 1577 1588 try { 1578 1589 // Implicit block. … … 1582 1593 if (eval(test, ext, thread) != NIL) 1583 1594 break; 1584 progn(body, ext, thread); 1595 remaining = body; 1596 while (remaining != NIL) { 1597 LispObject current = remaining.car(); 1598 if (current instanceof Cons) { 1599 try { 1600 // Handle GO inline if possible. 1601 if (current.car() == Symbol.GO) { 1602 LispObject code = null; 1603 LispObject tag = current.cadr(); 1604 for (Binding binding = tags; binding != null; binding = binding.next) { 1605 if (binding.symbol.eql(tag)) { 1606 code = binding.value; 1607 break; 1608 } 1609 } 1610 if (code != null) { 1611 remaining = code; 1612 continue; 1613 } 1614 throw new Go(tag); 1615 } 1616 eval(current, ext, thread); 1617 } 1618 catch (Go go) { 1619 LispObject code = null; 1620 LispObject tag = go.getTag(); 1621 for (Binding binding = tags; binding != null; binding = binding.next) { 1622 if (binding.symbol.eql(tag)) { 1623 code = binding.value; 1624 break; 1625 } 1626 } 1627 if (code != null) { 1628 remaining = code; 1629 thread.setStackDepth(depth); 1630 continue; 1631 } 1632 throw go; 1633 } 1634 } 1635 remaining = remaining.cdr(); 1636 } 1585 1637 // Update variables. 1586 1638 if (sequential) {
Note: See TracChangeset
for help on using the changeset viewer.