[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in setf and arraycall



Seems to be a problem with push and arraycall.  Here's the source file:

    (defvst bug-st
        (a = (*array () t 10))
    )

    (defmacro bug-st-ai (self index)
        `(arraycall t (bug-st-a ,self) ,index))


    (defun bug (self member index)
        (push member (bug-st-ai self index)))


    (setq b (cons-a-bug-st))


    (bug b 'a 4)

    (bug b 'a 4)


And here's how Maclisp takes it:

    Yale Haclisp 82 (in Maclisp 2088)
    > (defvst bug-st
        (a = (*array () t 10))
    )
    ;Loading DEFVST 3
    ;Loading EXTMAC 183
    ;Loading ERRCK 20
    ;Loading VECTOR 64
    ;Loading DEFVSX 85
    BUG-ST
    >(defmacro bug-st-ai (self index)
        `(arraycall t (bug-st-a ,self) ,index))
    BUG-ST-AI
    >(defun bug (self member index)
        (push member (bug-st-ai self index)))
    BUG
    >(setq b (cons-a-bug-st))
    #{BUG-ST A #T-10-71712}
    >(bug b 'a 4)
    (A)
    >(bug b 'a 4)
    ;G0017 UNBOUND VARIABLE

    ;BKPT UNBND-VRBL
    > (baktrace)
    BAKTRACE
    +INTERNAL-UBV-BREAK_ ARRAYCALL_ PUSH_ BUG_


It seems especially odd to me that things should blow up only after the
second call to bug.
-------