Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method name not shown from within an iterate loop using sbcl #30

Open
MartinBuchmann opened this issue Feb 23, 2019 · 2 comments
Open
Labels

Comments

@MartinBuchmann
Copy link

Using sbcl the method name is empty in the log message from the method not-working. With ccl or omitting the (aref...) statement it is working. Could someone please confirm this? I assume iterate does something log4cl can not understand, neither do I...

(ql:quickload "iterate")
(ql:quickload "log4cl")

(defpackage :minimal
  (:use #:cl #:iterate)) 

(in-package :minimal)

(defclass test ()
  ((a :documentation "test-a"
      :initform (make-array '(3 3)
			    :element-type 'integer
			    :initial-element 0)
      :initarg :a)))

(defvar *a* (make-instance 'test))

(defmethod not-working ((test test))
  (with-slots (a) test
    (iter
      (for i below 3)
      (iter
        (for j below 3)
        (unless (= 10 (aref a i j)) 
          (log:info "R: ~D C: ~D" i j))))))

(defmethod working ((test test))
  (with-slots (a) test
    (loop
      for i below 3
      do (loop
           for j below 3
           unless (= 10 (aref a i j))
             do (log:info "I: ~D J: ~D" i j)))))

(defmethod also-working ((test test))
  (with-slots (a) test
    (iter
      (for i below 3)
      (iter
        (for j below 3)
        (unless (= 10 j) 
          (log:info "R: ~D C: ~D" i j))))))

(not-working *a*)
(working *a*)
(also-working *a*)

@scymtym scymtym added the bug label Feb 25, 2019
@scymtym
Copy link
Member

scymtym commented Feb 25, 2019

Reduced to

(defmethod not-working ((test t))
  (iter (log:info "bla") 
        (slot-value test 'b)))

@scymtym
Copy link
Member

scymtym commented Feb 25, 2019

In the non-working cases, log4cl-impl::sbcl-get-block-name fails to determine the block name because (sb-c::lexenv-lambda env) returns nil for the initial environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants