Opened 9 years ago

Closed 9 years ago

#817 closed defect (invalid)

inline notinline

Reported by: Frank Owned by:
Priority: normal Milestone:
Component: ANSI CL Compliance Version: trunk
Keywords: inline notinline Cc:

Description

What I was trying to do is to declare a function inline. That function has a macro inside. Depending on whether I declaim it inline or notinline I get two different outcomes.

Well I assume that we always should get the same outcome (semantically) independent of whether we declaim something inline or notinline.

Here's a demo:

(in-package :cl-user)

(defpackage :test
  (:use :cl))

(in-package :test)

(defmacro foo ()
  `(funcall ',(intern "FOOBAR")))

(defun foobar ()
  42)

(declaim (inline bar))
(defun bar ()
  (foo))

(in-package :cl-user)

(defun busted ()
  (test::bar))

;; Just for information...
(find-symbol "FOOBAR")			; => FOOBAR, :INTERNAL

;; Error!
(busted)

;;; Lets try it with bar not being inlined.
;;; =======================================

(in-package :test)

(declaim (notinline bar))
(defun bar ()
  (foo))

(in-package :cl-user)

(unintern 'foobar)			; GC that

(defun busted ()
  (test::bar))

;; Runs fine this time.
(busted)

;; Just for information...
(find-symbol "FOOBAR")			; => NIL, NIL

Change History (1)

comment:1 Changed 9 years ago by Frank

  • Priority changed from critical to normal
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.