Opened 9 years ago

Closed 9 years ago

#656 closed defect (invalid)

dolist's result-form was not accepted by ccl

Reported by: cmo-0 Owned by: gb
Priority: critical Milestone: Clozure CL 1.5
Component: ANSI CL Compliance Version: 1.4
Keywords: dolist Cc:

Description

I'm using "Version 1.4-r13122 (WindowsX8632)", on a windows xp professional box (with Service pack 3)

while working on a project I found that ccl does not understand the result-form of the dolist macro.

double checking with CLHS to insure i didn't make fool of myself. http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_dolist.html

and then taking one of the examples from the above page:

(dolist (temp-one '(1 2 3 4) temp-two) (push temp-one temp-two))

gave me the following in ccl:

Welcome to Clozure Common Lisp Version 1.4-r13122  (WindowsX8632)!
?  (dolist (temp-one '(1 2 3 4) temp-two) (push temp-one temp-two))
;Compiler warnings :
;   In an anonymous lambda form: Undeclared free variable TEMP-TWO (3 references
)
> Error: Unbound variable: TEMP-TWO
> While executing: #<Anonymous Function #x8CB4D7E>, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 >

rather than giving me => (4 3 2 1)

Change History (1)

comment:1 Changed 9 years ago by gb

  • Resolution set to invalid
  • Status changed from new to closed

Notice the:

(setq temp-two nil)

that precedes the use of DOLIST in that example.

(It's not the world's best example, since introducing global variables without declaring them to be SPECIAL will likely cause warnings to that effect when those variables are referenced in compiled code. You see those compile-time warnings above, and also see the basis for those warnings, since the variable TEMP-TWO in fact had no value at run time.)

Note: See TracTickets for help on using tickets.