[LISPWORKS][Common Lisp HyperSpec (TM)] [Previous][Up][Next]


Issue DO-SYMBOLS-BLOCK-SCOPE Writeup

Issue:             DO-SYMBOLS-BLOCK-SCOPE

References: DO-SYMBOLS, DO-EXTERNAL-SYMBOLS, DO-ALL-SYMBOLS

Related issues:

Category: CLARIFICATION

Edit history: v1, 13 Feb 1991, Sandra Loosemore

Problem description:

It's not clear what the scope of the implicit NIL block surrounding

a DO-SYMBOLS, DO-EXTERNAL-SYMBOLS, or DO-ALL-SYMBOLS form is. Does

it include only the body forms or the entire form?

Proposal (DO-SYMBOLS-BLOCK-SCOPE:ENTIRE-FORM):

Clarify that the implicit NIL block effectively surrounds the entire

DO-SYMBOLS, DO-EXTERNAL-SYMBOLS, or DO-ALL-SYMBOLS form.

Rationale:

This is consistent with DO, DO*, DOLIST, and DOTIMES.

Examples:

(block nil

(do-symbols (s (or (find-package "FROB") (return nil)))

(print s))

t)

=> always returns T since BLOCK referred to by the RETURN is the

implicit BLOCK established by DO-SYMBOLS, not the explicit outer

BLOCK.

Current Practice:

Lucid version 4.0 implements this proposal.

Allegro version 3.1 implements DO-EXTERNAL-SYMBOLS and DO-ALL-SYMBOLS

according to this proposal, but not DO-SYMBOLS.

Chestnut's Lisp-to-C translator implements this proposal.

Cost to Implementors:

Small.

Cost to Users:

None.

Cost of non-adoption:

Implementations will differ and the language specification will be vague,

without any good reason.

Performance impact:

Probably none.

Benefits:

The cost of non-adoption is avoided.

Esthetics:

Making the language consistent is a good thing.

Discussion:

-------


[Starting Points][Contents][Index][Symbols][Glossary][Issues]
Copyright 1996-2005, LispWorks Ltd. All rights reserved.