Zachary D'Anthony on Nostr: Today I learned that I don't understand Loop at all. (loop for y = 0 then z for x ...
Today I learned that I don't understand Loop at all.
(loop for y = 0 then z
for x from 1 to 5
sum 1 into z
finally (return (values y z)))
;; => 5
;; 5
(loop for x from 1 to 5
for y = 0 then z
sum 1 into z
finally (return (values y z)))
;; => 4
;; 5
#lisp
Published at
2024-06-04 22:15:59Event JSON
{
"id": "3cb033a9ae7c790d97dcbc3084ff8817b8a6357a437f53f6e429cd136c6fe8bc",
"pubkey": "3d73298ff88854eb8ea60d8d6f2a1f770a14b16943c42645ccb68ba8a16253a6",
"created_at": 1717539359,
"kind": 1,
"tags": [
[
"t",
"lisp"
],
[
"proxy",
"https://emacs.ch/users/zyd/statuses/112560659486828052",
"activitypub"
]
],
"content": "Today I learned that I don't understand Loop at all.\n\n(loop for y = 0 then z\n for x from 1 to 5\n sum 1 into z\n finally (return (values y z)))\n;; =\u003e 5\n;; 5\n\n(loop for x from 1 to 5\n for y = 0 then z\n sum 1 into z\n finally (return (values y z)))\n;; =\u003e 4\n;; 5\n\n\n#lisp",
"sig": "256ab0e0de7270755976b4b9f0a71f46ed6f85c7da7ce707e2ca234b3a249b02e9bd450a7fe1e2441018b0764e651c7473eb258bcc43bc135ecc8ae3d3f45e77"
}