💬 Reply by screwtape

2024-11-17 ┃ RE: screwtape

@fosskers
Ugh, it's 10x slower than this loop facility one.
(defun loopfizz-of (no)
(let ((res (loop :repeat (1+ no)
:for x :from 0 :by 1 :for y := '0 :then y :for z := '0 :then z
:when (eql x y) :do (incf y 3)
:When (eql x z) :do (incf z 5)
:finally (return (list x (decf y 3) (decf z 5))))))
(cond ((and (= (car res) (cadr res)) (= (car res) (caddr res))) '(fizz buzz))
((= (car res) (cadr res)) '(fizz)) ((= (car res) (caddr res)) '(buzz))
(:otherwise (butlast res 2)))))

screwtape

https://mastodon.sdf.org/@screwtape/113496022111086255

fosskers

💬 Replies

2024-11-17 CryogenicIce9 ┃ 1👤 1💬

@screwtape @fosskers I hate loop soooo much, every time I see it, it gnaws at me like an open wound

2024-11-17 screwtape ┃ 2#️ 1👤

@fosskers
(defun eg (x)
(let* ((nos (scan-range))
[…]

────

View parent post

View first post in thread

────

📡 Local feed

🏕️ Communities

🔥 Hashtags

🔎 Search posts

🔑 Sign in

📊 Status

🛟 Help