Custom Query (1030 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (631 - 633 of 1030)

Ticket Resolution Summary Owner Reporter
#1010 duplicate (setf schar) with fixnum index fails Willem Broekema
Description
Clozure CL "Version 1.8-r15286M  (LinuxX8632)"

(defun test ()
  (let ((bit-arr (make-array 1000 :element-type 'bit :initial-element 0)))
    ;; Set one bit in the array, for #\A
    (setf (aref bit-arr (char-code #\A)) 1)
    (let ((num-chars 1)
          (char-arr (make-string 1)))
      ;; loop over the bit array, finding the bit, and putting #\A in CHAR-ARR
      (loop for src-char-code fixnum from 0
            with ret-ix fixnum = 0
            when (= (sbit bit-arr src-char-code) 1)
            do (progn (setf (schar char-arr ret-ix) (code-char src-char-code))
                      (incf ret-ix)
                      (if (= ret-ix num-chars)
                          (return)
                        (warn "(ret-ix) ~A != ~A (num-chars)" ret-ix num-chars))))
      char-arr)))

Running gives:

  Warning: (ret-ix) 1 != 1 (num-chars)
  ; While executing: COMMON-LISP-USER::TEST, in process listener(1).
  > Error: Array index 1000 out of bounds for #<SIMPLE-BIT-VECTOR 1000>

Removing the FIXNUM declaration for RET-IX inside the loop solves it:

  ..
  with ret-ix = 0
  ..
#1412 fixed BOGUS object when using REPLACE with adjustable vectors Willem Broekema
Description

Using Clozure Common Lisp Version 1.11-r16635 (LinuxX8664):

(let ((x (make-array 3 :adjustable t :fill-pointer 0)))
  (vector-push-extend 1 x)
  (vector-push-extend 2 x)
  (vector-push-extend 3 x)
  (assert (equalp x #(1 2 3)))

  (let* ((twice (make-array (* 2 (length x))
                            :adjustable t
                            :fill-pointer (* 2 (length x))
                            :initial-element nil)))
    (assert (equalp twice #(nil nil nil nil nil nil)))

    (replace twice x :start1 3)
    ;; TWICE should now be: #(NIL NIL NIL 1 2 3)                                                                                                
    (format t "Twice: ~S" twice)))

leads to:

Twice:
> Error: Bug (probably): can't determine class of #<BOGUS object @ #x30200105879D>
> While executing: CCL::NO-CLASS-ERROR, in process listener(1).
#861 invalid overzealous and flaky warning about SETQ'd unused lexical variable/ Mark David
Description

Sometimes the compiler warns

style-warning: Unused lexical variable FOO

where FOO is some variable I've SETQ'd but then not referred to.

That's annoying enough. I don't think that should be done at all. It's a pain to have to throw away documentary (multiple-value-setq (x y z) ...) variables or go through other hoops just to get rid of this warning. Also, it's "used" by reasonable definition: it's set, just not "read" or "eval'd". Whatever. It's a pain to encounter and to work around.

But that's not the main point.

Sometimes -- not always!! -- I cannot even still the compiler by simply placing the variable inline to be evaluated.

The compiler first of all is so clever as to optimize out the reference, then turns on me and tells me it's not referenced. That is quite frustrating to put it mildly.

Seems to happen in big functions. Small functions work fine, so I cannot give you an example. But it's like this:

  (defun foo (a b) 
       (let (c d)
         (multiple-value-setq (c d) (round a b))
         c))

always warns about D "unused" (annoying to me, but I can deal with it)

  (defun foo (a b) 
       (let (c d)
         (multiple-value-setq (c d) (round a b))
         d
         c))

not in this case, but in some larger functions, warns about D -- unacceptable, bug, etc.!

Note: let me know if this is a known problem: that is, the flakyness (dependency on function size, or whatever), or -- if not -- if you need an example. I'll put cycles on it, but would rather not if it's already known.

Version info:

            CCL::*OPENMCL-MAJOR-VERSION*,  Value: 1
            CCL::*OPENMCL-MINOR-VERSION*,  Value: 6

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.