Opened 11 years ago

Closed 10 years ago

#339 closed enhancement (invalid)

provide macro with-readtable-iterator

Reported by: S11001001 Owned by: gz
Priority: minor Milestone:
Component: Runtime (threads, GC) Version:
Keywords: Cc:

Description

with-readtable-iterator is a macro proposed as a de-facto standard extension to Common Lisp by Tobias Rittweiler. It is currently implemented in the with-readtable-iterator branch of Git repository git://repo.or.cz/sbcl/tcr.git (gitweb).

The macro allows efficient iteration over the reader macros provided in a particular readtable, more than can be provided with ANSI-standard functionality, especially given very large values of char-code-limit. Tobias's named-readtable (Darcs) for SBCL and Clozure CL, which implements Allegro-like named readtables, uses with-readtable-iterator to merge macros provided by multiple readtables into a single readtable.

Attached is a patch made against r10880 that implements this macro and exports it from CCL. The `with-readtable-iterator' macro body itself is borrowed from Tobias's SBCL implementation.

Attachments (3)

ccl.with-readtable-iterator.diff (2.1 KB) - added by S11001001 11 years ago.
initial patch
ccl.with-readtable-iterator.2.diff (3.2 KB) - added by S11001001 11 years ago.
update to tcr's CDR proposal
ccl.with-readtable-iterator.3.diff (3.3 KB) - added by S11001001 11 years ago.
based on proposed changes to the CDR

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by S11001001

initial patch

comment:1 Changed 11 years ago by gz

  • Owner changed from gb to gz

This proposal seems to still be evolving, this patch doesn't correspond to the current version.

Changed 11 years ago by S11001001

update to tcr's CDR proposal

comment:2 Changed 11 years ago by S11001001

I've updated to the proposed CDR. However:

  1. The proposal doesn't specify what macro-char-types is supposed to mean, exactly. My implementation is based on conversations with tcr.
  2. The proposal doesn't specify what modifying the last macro character may do with respect to the dispatch-alist. I've mentioned this on cdr-discuss in more detail.

Changed 11 years ago by S11001001

based on proposed changes to the CDR

comment:3 Changed 11 years ago by S11001001

3 changes the error when name isn't a symbol to program-error, and implements the two changes I just proposed.

comment:4 Changed 10 years ago by gz

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

Added in r12693

comment:5 Changed 10 years ago by trittweiler

  • Resolution fixed deleted
  • Status changed from closed to reopened

I'm the author of the original proposal which dates more than year back and which has been the base of Stepen Compall's patch.

In the mean time, I came to the conclusion that the proposed interface is bogus. At the time, I mistakenly took that readtables are simply containers for reader macros, but that's not true: they also include information about each character's syntax type.

I'm going to revisit the proposal. In the new proposal, the interface will probably look along the line of

(defmacro with-readtable-iterator ((name &rest character-syntax-types)

&body body)

...)

I hence request to not publically export the API as has been comitted a few weeks ago, and tell in its docstring that the interface is going to change.

-T.

comment:6 Changed 10 years ago by gz

  • Component changed from Infrastructure and Support to Runtime (threads, GC)
  • Resolution set to invalid
  • Status changed from reopened to closed

r12925 removes the bogus definition. Since there is no current proposal, I'm marking this as "invalid" for now. Please reopen when a new design is agreed upon.

Note: See TracTickets for help on using tickets.