Skip to content

RUTILS.ITER:ITER, :in-vector or :in-sequence "The value NIL is not of type NUMBER" #61

Description

@piknik

The code:

(rutils.iter:iter
	  (:for item :in-vector #(1 2 3 4 5))
	  (format t "Hi ~A~%" item))

or

(rutils.iter:iter
	  (:for item :in-sequence #(1 2 3 4 5))
	  (format t "Hi ~A~%" item))

causes the following error:

The value
  NIL
is not of type
  NUMBER
   [Condition of type TYPE-ERROR]

Backtrace:

  0: (SB-KERNEL:%NEGATE NIL)
  1: (- NIL)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (- NIL) #<NULL-LEXENV>)
  3: (EVAL (- NIL))
  4: (RUTILS.ITER::RETURN-SEQ-CODE :ELEMENT-VAR ITEM :SEQUENCE #(1 2 3 4 5) :ACCESS-FN AREF :SIZE-FN #<unavailable argument> :ELEMENT-TYPE NIL :SEQUENCE-TYPE #<unavailable argument> :FROM #<unavailable arg..
  5: (RUTILS.ITER::APPLY-CLAUSE-FUNCTION #<unavailable argument> #<unavailable argument>)
  6: (RUTILS.ITER::PROCESS-CLAUSE #<unavailable argument>)
  7: (RUTILS.ITER::WALK-LIST-NCONCING #<unavailable argument> #<FUNCTION RUTILS.ITER::WALK> #<FUNCTION (LAMBDA (RUTILS.ITER::FORM RUTILS.ITER::BODY) :IN "/home/piknik/.local/share/common-lisp/source/rutils..
  8: ((MACRO-FUNCTION RUTILS.ITER:ITER) #<unavailable argument> #<unavailable argument>)
  9: ((FLET SB-IMPL::PERFORM-EXPANSION :IN MACROEXPAND-1) #<FUNCTION (MACRO-FUNCTION RUTILS.ITER:ITER) {52A7C70B}> NIL)
 10: (MACROEXPAND (RUTILS.ITER:ITER (:FOR ITEM :IN-VECTOR #(1 2 3 4 5)) (FORMAT T "Hi ~A~%" ITEM)) #<NULL-LEXENV>)
 11: (SB-INT:SIMPLE-EVAL-IN-LEXENV (RUTILS.ITER:ITER (:FOR ITEM :IN-VECTOR #(1 2 3 4 5)) (FORMAT T "Hi ~A~%" ITEM)) #<NULL-LEXENV>)
 12: (EVAL (RUTILS.ITER:ITER (:FOR ITEM :IN-VECTOR #(1 2 3 4 5)) (FORMAT T "Hi ~A~%" ITEM)))

The following code outputs the expected result:

(rutils.iter:iter
	  (:for item :in '(1 2 3 4 5))
	  (format t "Hi ~A~%" item))
Hi 1
Hi 2
Hi 3
Hi 4
Hi 5

Not sure what I am doing wrong or if it's a bug. Used both the current quicklisp version and the master branch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions