Previous: , Up: Miscellaneous   [Contents][Index]


13.3.7.3 Loop Extensions

CMUCL supports extensions to the extended loop facility. The extension is similar to the for-as-hash and for-as-package loop forms allowing the user to process the codepoints or glyphs of a string.

‘(loop for cp being the codepoint of string ...)‘ extracts the consecutive codepoints from the string, placing the codepoint in cp. Allow codepoints, code-point, and code-points as aliases of codepoint. Iteration stops when there are no more codepoints in string.

‘(loop for g-string being the glyph of string ...)‘ extracts each glyph (as a string) from the string, placing the glyph in g-string. Allow glpyhs as an alias for glyph. Iteration stops when there are no more glpyhs in string.