Richard Schneeman on Nostr: I can define a const easilly enough, but then I want a way to iterate over all the ...
I can define a const easilly enough, but then I want a way to iterate over all the consts within some given scope.
I can separately add it to a const array, but that requires me to remember for every new item added and it's not easy or intuitive to code a test that would catch mistakes. I'm thinking maybe something with macros could make this easier. I'm wondering if there's prior art here or maybe I'm missing something super simple.
Published at
2024-11-01 17:24:43Event JSON
{
"id": "42be5fa6f31df7b6637a4f3fcb8b5b5d8eacb0bb4a580ab4641ca7546c746bc5",
"pubkey": "5c931aab4bd50aef18e4fd6a257cb53bb70fee015066bea9102ac27a8e230f5c",
"created_at": 1730481883,
"kind": 1,
"tags": [
[
"e",
"21fb952906811ae97d5da3ea1e764d1099fab3689fcc85e08de5140dc8ee506e",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://ruby.social/users/Schneems/statuses/113408860690193841",
"activitypub"
]
],
"content": "I can define a const easilly enough, but then I want a way to iterate over all the consts within some given scope. \n\nI can separately add it to a const array, but that requires me to remember for every new item added and it's not easy or intuitive to code a test that would catch mistakes. I'm thinking maybe something with macros could make this easier. I'm wondering if there's prior art here or maybe I'm missing something super simple.",
"sig": "7c5dae778a782bf527b98a051b806165acbe5cf3e33e7f9afd7974cdcedbff1b5c1dbd234e569ab512807d379240d35329cb2d7bb59263c46b074ffcb9aef753"
}