fmakunbound fails for macros in SBCL 1.0.49

Bug #795705 reported by Matt Kaufmann on 2011-06-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Quoting the CL Hyperspec on fmakunbound:

     Removes the function or macro definition, if any, of name in the global environment.

This worked in SBCL 1.0.45 but fails in 1.0.49. Here are logs for
64-bit linux.

; 1.0.45 (worked)

  * (defmacro foo (x) x)

  * (fmakunbound 'foo)

  * (macro-function 'foo)


; 1.0.49 (failed)

  * (defmacro foo (x) x)

  * (fmakunbound 'foo)

  * (macro-function 'foo)


Other info requested for a bug report:

sloth:~> ~/bin/sbcl --version
SBCL 1.0.49
sloth:~> uname -a
Linux sloth 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
sloth:~> ~/bin/sbcl
This is SBCL 1.0.49, an implementation of ANSI Common Lisp.
More information about SBCL is available at <>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* *features*


Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
importance: Undecided → High
status: New → In Progress
Nikodemus Siivola (nikodemus) wrote :

commit 39c9c1d494f6d8a42c6f701ef1db4f688fe1b310
Author: Nikodemus Siivola <email address hidden>
Date: Fri Jun 10 23:30:52 2011 +0300

    FMAKUNBOUND removes the MACRO-FUNCTION as well

      Fixes lp#795705.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Matt Kaufmann (kaufmann) wrote :

Thank you for fixing this so quickly!

Is there a bit of code I can put into my sources that works around this
problem? (Otherwise, I'll need to disallow builds of ACL2 on SBCL

Nikodemus Siivola (nikodemus) wrote :

;;; Untested, but should work

(in-package :sb-c)


(defun undefine-fun-name (name)
  (when name
    (macrolet ((frob (type &optional val)
                 `(unless (eq (info :function ,type name) ,val)
                    (setf (info :function ,type name) ,val))))
      (frob :info)
      (frob :type (specifier-type 'function))
      (frob :where-from :assumed)
      (frob :inlinep)
      (frob :kind)
      (frob :macro-function)
      (frob :inline-expansion-designator)
      (frob :source-transform)
      (frob :structure-accessor)
      (frob :assumed-type)))


>> ;;; Untested, but should work

Thank you! That does the trick.

Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers