From Newsgroup: comp.lang.lisp
Pascal Costanza wrote:
For example, why don't you just write this?
(defun powersn (x n)
(loop for i from to n collecting (expt x i)))
Rejected by SBCL:
; in: LAMBDA NIL
; (LOOP FOR I FROM TO N
; COLLECTING (EXPT X I))
;
; caught ERROR:
; (in macroexpansion of (LOOP FOR I ...))
; (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
; unknown LOOP keyword: N
; current LOOP context: N COLLECTING.
Gauche Scheme.
(define (powersn x n)
(map (cut expt x <>) (liota n 1)))
(powersn 3 5)
===>
(3 9 27 81 243)
--- Synchronet 3.21d-Linux NewsLink 1.2