ICScaryThings on Nostr: old school kirby The statement is more confusing when you are new to C because ...
old school kirby (npub1wg0…t0yf) (npub1psx…gvsy) The statement is more confusing when you are new to C because other languages (e.g. python, etc.) don't often allow assignment inside a nested expression and even if they do they usually don't return a value. In C when I do e.g. (x = 5) + 1, it assigns to variable x first then returns the same value assigned. Thus "(x = 5)" reduces to 5 and then is added to 1.
The thing I wrote above assigns the pointer address in the nested expression and then dereferences the returned pointer to set the terminating null (0 == '\0' in C so you can set that either way). These sorts of tricks are used a lot in the actual K&R book e.g. while ( (c = fgetc(f)) != EOF ) to loop over input one character at a time until the end of file.
Published at
2023-08-23 23:32:03Event JSON
{
"id": "7bee0ab390879b34e37cd93fae874b45690dbb1dced6230d47ab579bb8b00466",
"pubkey": "6175da632a8c9187a4368f0c8ad67b8a6e884f16d456954ba53b1d60696c4079",
"created_at": 1692833523,
"kind": 1,
"tags": [
[
"p",
"721eacb3df4ee6374240e2978da81baa1daa75cf6908e4b988ea4130112f53b6",
"wss://relay.mostr.pub"
],
[
"p",
"0c0de16ff59e79a63e29ce820c3435fb309ad6bb4c1c4a8fe9128f03c9cb1496",
"wss://relay.mostr.pub"
],
[
"e",
"b61988e3b3e7a49a8d7bd1aa04ec0ad56849df40dd0d453b736f76ac52fc9194",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://clubcyberia.co/objects/de54e146-61ea-4011-925b-8587a33cef8b",
"activitypub"
]
],
"content": "nostr:npub1wg02ev7lfmnrwsjqu2tcm2qm4gw65aw0dyywfwvgafqnqyf02wmqhht0yf nostr:npub1psx7zml4neu6v03fe6pqcdp4lvcf444mfswy4rlfz28s8jwtzjtqrxgvsy The statement is more confusing when you are new to C because other languages (e.g. python, etc.) don't often allow assignment inside a nested expression and even if they do they usually don't return a value. In C when I do e.g. (x = 5) + 1, it assigns to variable x first then returns the same value assigned. Thus \"(x = 5)\" reduces to 5 and then is added to 1.\n\nThe thing I wrote above assigns the pointer address in the nested expression and then dereferences the returned pointer to set the terminating null (0 == '\\0' in C so you can set that either way). These sorts of tricks are used a lot in the actual K\u0026R book e.g. while ( (c = fgetc(f)) != EOF ) to loop over input one character at a time until the end of file.",
"sig": "8289a5578885a916931fbd426df1135873ce1959929f8a14130fe94e8c359eacc6ccdaa86899dec60bba750be66043e374d8269378a46a8dee34b4f597c9be51"
}