[LispM] odd Explorer behavior - interpreted vs. compiled

r.stricklin bear at typewritten.org
Wed Oct 12 18:42:29 PDT 2016


Howdy, folks.

I have an odd issue I'm at a loss to explain and lack insight re: where to start troubleshooting.

I have a function which is meant to take a number and a list of numbers as arguments, and return T if the number is evenly divisible by any number in the list. Nil, if the number is not evenly divisible by any of the numbers in the list.

(defun divp (n list)
  (block nil (mapcar #'(lambda (p) 
                   (cond ((zerop (mod n p)) (return T)))) list)
               (return nil)))


This works exactly as I expect, whether compiled or interpreted, on Allegro CL and in Genera 8. On the microExplorer (Release 6.1 if it matters), it works exactly as I expect... until I compile it. Once it's compiled, it always returns nil.

For example, the expected behavior, and what is observed from Allegro CL, Genera:

> (divp 5 '(2 3))
NIL
> (divp 6 '(2 3))
T

What happens on microExplorer, but only when compiled:

> (divp 5 '(2 3))
NIL
> (divp 6 '(2 3))
NIL

Anybody have any ideas? Am I overlooking something really obvious? What might I do to figure out how/why it's going wrong?

ok
bear.

-- 
until further notice



More information about the LispM mailing list