april icon indicating copy to clipboard operation
april copied to clipboard

Allocate-instance without breaks on va-class

Open Yehouda opened this issue 1 year ago • 4 comments

https://github.com/phantomics/april/blob/fdb651498768c7e4b2e62ea68ce3954e1fee18c0/varray/base.lisp#L110

On LispWorks, calling allocate-instance on *va-class breaks. It happens when some code calls (class-prototype 'va-class), so it needs to work.

In our tst code. I changed this definition to:

(defmethod allocate-instance ((this-class va-class) &rest params)
  "Extend allocation logic for all virtual array classes. This function acts as an interface to the extend-allocator functions (mostly found in combinatorics.lisp) which provide for special allocation behavior of virtual array classes; specifically the potential for their allocation to return a modified form of the base object rather than an instance of their actual class."
  (or (and  params  ; class-prototype 
            (let ((fname (intern (format nil "EXTEND-ALLOCATOR-~a" (string-upcase (class-name this-class)))
                                 *package-name-string*)))
              ;; TODO: make the EXTEND-ALLOCATOR- symbol part of the classes so this
              ;; string processing is not needed with every allocation
              (when  (fboundp fname) (apply (symbol-function fname) params))))
      (call-next-method)))

Yehouda avatar Dec 10 '24 17:12 Yehouda

Thanks for testing April with LispWorks, are you testing LW with different popular libraries? I changed the allocate-instance code, can you try it now? Also, a friend who tested LW in the past had problems with some of the library tests, could you try running those? You can do that by running (load-libs) (run-lib-tests) in the April package. Appreciate it.

phantomics avatar Dec 11 '24 13:12 phantomics

I am not really testing it. We try to load and compile "all" of quicklisp systems, and when we find easy to run tests also run them. This issue caused the LispWorks compiler to error, because it uses class-prototype when computing the acceptable initargs when compiling (make-ins

I just ran (april::load-libs) and (april::run-lib-tests). It filled my shell with various stuff, and claimed that there was one failure.

Yehouda avatar Dec 11 '24 14:12 Yehouda

Could you find out where the failure was? You can tell by the × symbol at the left edge of the test output. Successful tests are indicated by the character while × indicates failure, so it should be easy to find doing a text search. Keep in mind that × is a functional character in APL too, so it's important to check that the character is at the left edge of the text output and not in the middle of a code string.

Last time I had a friend test April with LW there were a few failures, mostly relating to trigonometry and complex numbers. Would be good to get April fully working with LW. Thanks.

phantomics avatar Dec 12 '24 12:12 phantomics

april-output.txt

The failure is in line 39. For markers that you want to search for, you really should use only charcters that are available on a typical english keyboard. Something like "-->>" make it easy to find both by search and visually.

Yehouda avatar Dec 12 '24 13:12 Yehouda