Re: Storing values separately for cl-loop

tpeplt <[email protected]> Fri, 10 Jul 2026 08:33:37 -0400
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Heime <[email protected]> writes:

> How can I store the result of (format "%s %s%d%s%s" prefix "<" i ">" tag)
> separately for cl-loop?
>
>       (let ( (prefix  (if (= (length comment-start) 1)
>                           ;; Single character comment start
> 	                  (make-string 3 (string-to-char comment-start))
>                         ;; Multiple character comment start  
>                         comment-start))
> 	     (tag     (if tag (format "%s" tag) "")) )
>         (cl-loop for i from 1 to n
>                    collect (cons (format "%s %s%d%s%s" prefix "<" i ">" tag)
>                                  i)))
>

Can you describe or provide an example of the output of
‘cl-loop’ that you are attempting to produce?  It is unclear
(to me, at least) what you are asking.

Also, the code that you provided has two problems:

  1. ‘tag’ is referenced, but it is undefined.  You could
     provide an example with ‘tag’ replaced by a constant
     value.
  2. ‘for i from 1 to n’ references ‘n’, but it is
     undefined.

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.