Skip to content

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

@MartinBuchmann

Description

@MartinBuchmann

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*)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions