Extend LOOP BEING THE ELEMENTS OF extension

Bug #1850277 reported by Michał "phoe" Herda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Wishlist
Unassigned

Bug Description

http://www.lispworks.com/documentation/lcl50/loop/loop-50.html mentions further extensions to LOOP ... BEING THE ELEMENTS OF iteration path, for example:

;; Print the characters in a string, which is also a vector.
> (loop for x being the elements of "abcde" from 2
        do (print x))
#\c
#\d
#\e
NIL

This example currently fails on SBCL due to `FROM 2` not being expected in this LOOP context.

Revision history for this message
Douglas Katzman (dougk) wrote :

A loop extension would make sense only when there is no portable way to iterate on a thing.
This loop has a portable equivalent of:
(loop with v = "abcde" for i from 2 below (length v)
      for x = (aref v i) do (print x))

Quicklisp has a bunch of extensible iteration macros to choose from.

Revision history for this message
Stas Boukarev (stassats) wrote :

there's no portable way of iterating on sequences.

Stas Boukarev (stassats)
Changed in sbcl:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.