From: Robert S. <rd...@me...> - 2004-02-18 15:23:32
|
On Feb 18, 2004, at 1:43 AM, Andreas Fuchs wrote: > Today, Robert Sedgewick <rd...@me...> wrote: >> Has anyone had any luck using the iterate package with sbcl on >> darwin? > > Never tried that before... > >> With iterate 1.0.2 and sbcl 0.8.7.52 (and also 0.8.5.something) I >> get a "TYPE-ERROR in thread 914: The value 2 is not of type LIST." >> when I """ >> * (in-package :iterate) >> #<PACKAGE "ITERATE"> >> * (iter (for i from 0 below 10) >> (collect (* 4 i))) >> """ >> >> This code works in openmcl and in sbcl on x86. > > I saw it work on sbcl/x86, too. Can you post a few macroexpand-1 steps > of: > > * (macroexpand-1 '(iter (for i from 0 below 10) > (collect (* 4 i)))) > * (macroexpand-1 (macroexpand-1 '(iter (for i from 0 below 10) > (collect (* 4 i))))) > I should have mentioned that the error is during macroexpansion. > , etc on sbcl/darwin? That would help a bit, as I don't have access to > sbcl on a darwin machine at the moment. Well, I would give you an account here, but all I have is a laptop that is behind a firewall..... >> Poking around a little it looks like something screwy is going on >> with the multiple-value-bind in the function walk-list-nconcing in >> iterate.lisp. Something which should be nil gets set to something >> random (in this case 2). > > Hmm. So is this condition raised during macroexpansion or when the > resulting code is executed? As I said above, a few MACROEXPAND-1s > would help. Also, you could try (setf *BREAK-ON-SIGNALS* t) and > extract a backtrace. Setting *break-on-signals* doesn't change the error or where it occurs. The problem is that, in walk-list-nconcing, augment (which expands to nconc) gets called with a scalar, which, of course, isn't right. How it is getting a scalar is a mystery to me since the form that multiple-value-bind is called on returns only one value.... My guess is that memory is getting corrupted somewhere, but I'm not sure..... FYI the backtrace is 0: ("FLET SB!IMPL::FAIL" 2) 1: (NCONC 2)[:EXTERNAL] 2: ("hairy arg processor for ITERATE::WALK-LIST-NCONCING" (4 I) #<FUNCTION ITERATE::WALK> #<FUNCTION "#'(LAMBDA (#:G324 #:G325) (IF # # ...))" {48A6D9ED}>) 3: (ITERATE::WALK-ARGLIST (4 I)) 4: (ITERATE::RETURN-CODE-MODIFYING-BODY #<FUNCTION ITERATE::WALK-ARGLIST> (4 I) #<FUNCTION "CLOSURE" {48D0732D}>) 5: (ITERATE::WALK-EXPR (* 4 I)) 6: ("varargs entry for ITERATE::RETURN-COLLECTION-CODE" :VARIABLE NIL :EXPRESSION (* 4 I) :START-OPERATION CONS :END-OPERATION (SUBST (ITERATE::VAR ITERATE::EXPR) (LIST ITERATE::EXPR)) :ONE-ELEMENT T :TEST NIL :PLACE ITERATE::END :RESULT-TYPE LIST) 7: (ITERATE::APPLY-CLAUSE-FUNCTION ITERATE::CLAUSE-COLLECT-36 (:COLLECT (* 4 I))) 8: (ITERATE::PROCESS-CLAUSE (COLLECT (* 4 I))) 9: ("hairy arg processor for ITERATE::WALK-LIST-NCONCING" ((FOR I FROM 0 BELOW 10) (COLLECT (* 4 I))) #<FUNCTION ITERATE::WALK> #<FUNCTION "#'(LAMBDA (#:G336 #:G337) (DECLARE #) ...)" {48A6EAB5}>) 10: ("#'(LAMBDA (#:WHOLE245 #:ENVIRONMENT246) (LET* # #))" (ITER (FOR I FROM 0 BELOW 10) (COLLECT (* 4 I))) #S(SB-KERNEL:LEXENV :FUNS NIL :VARS NIL :BLOCKS NIL :TAGS NIL :TYPE-RESTRICTIONS NIL :LAMBDA NIL :CLEANUP NIL :POLICY ((SPEED . 1) (SPACE . 1) (SAFETY . 1) (INHIBIT-WARNINGS . 1) (DEBUG . 1) (COMPILATION-SPEED . 1)))) .... --Robbie > > Thanks for reporting this, > -- > Andreas Fuchs, <as...@bo...>, as...@ja..., antifuchs > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Sbcl-devel mailing list > Sbc...@li... > https://lists.sourceforge.net/lists/listinfo/sbcl-devel > |