Digital Mark λ 📚 🕹 💾 🥃 on Nostr: Python got loop-assignment (a while ago), great! while p:=nextPC(): stuff still fails ...
Python got loop-assignment (a while ago), great!
while p:=nextPC(): stuff
still fails because p might be 0, which is false. End up doing:
while (p:=nextPC()) is not None: stuff
Uugh. Still need to do more design on the toy impl before I start rewriting in something fast.
But, got named subroutines with local variables now. Just 436 LOC.
#retrocomputing #basic
Published at
2024-11-23 10:04:43Event JSON
{
"id": "410958946055b8b3eeed550eff986b8fb8647c095715bc9e3d8a712bb04103a3",
"pubkey": "fb87acbaf8ba707e56cf4f028fd6cc1e99b8a78fe8327cab70915f15631b0672",
"created_at": 1732356283,
"kind": 1,
"tags": [
[
"t",
"retrocomputing"
],
[
"t",
"basic"
],
[
"imeta",
"url https://cdn.masto.host/appdotnet/media_attachments/files/113/531/672/024/946/287/original/a60f63c0803bdeaa.jpg",
"m image/jpeg",
"dim 1679x1210",
"blurhash U12Fc4_3-;t7ofofayWBxut7j[ayRjWBj[of"
],
[
"imeta",
"url https://cdn.masto.host/appdotnet/media_attachments/files/113/531/672/392/585/642/original/50ea0ee096c5ac1d.jpg",
"m image/jpeg",
"dim 1514x288",
"blurhash U12~Jt~q?bx]=|r?f6ozrrMdM{t7$*VsRjkC"
],
[
"proxy",
"https://appdot.net/users/mdhughes/statuses/113531701377421198",
"activitypub"
]
],
"content": "Python got loop-assignment (a while ago), great!\n\nwhile p:=nextPC(): stuff\n\nstill fails because p might be 0, which is false. End up doing:\n\nwhile (p:=nextPC()) is not None: stuff\n\nUugh. Still need to do more design on the toy impl before I start rewriting in something fast.\n\nBut, got named subroutines with local variables now. Just 436 LOC.\n#retrocomputing #basic\n\nhttps://cdn.masto.host/appdotnet/media_attachments/files/113/531/672/024/946/287/original/a60f63c0803bdeaa.jpg\nhttps://cdn.masto.host/appdotnet/media_attachments/files/113/531/672/392/585/642/original/50ea0ee096c5ac1d.jpg",
"sig": "bce69c9f23eb0dace56ed9f3ac0112464475e74bd32399acb25f6c6afbaba6fc370cc28585c14e99c40dafb5cfd40eda2f1b505b0b8eef1b216a8b996c6d626a"
}