« first day (4935 days earlier)      last day (13 days later) » 

6:35 AM
I've found a better example of where if let Some(X) confuses me in Rust
 
I'm guessing but if insertion_ctx.problem.extras.get_capacity_keys() returns a Some the if executes right? With capacity_keys being assigned to the data in Some. Not really used Rust before.
 
My point is mainly that I can't reason it out easily with what looks like a double assignment. I find the syntax weird. I guess it's somewhat equivalent to our asspressions
 
I don't know Rust, is my guess correct?
 
It's shorthand for a match
 
Ok, I'll guess match is like PEP 636, and I've somehow misunderstood what the code is doing.
 
6:46 AM
I basically gave you that link because I don't trust my own interpretation of what let max_load_key = if let Some(capacity_keys) = insertion_ctx.problem.extras.get_capacity_keys() does
 
I can't even find an example like that in the official docs :/
Actually, if I just read it as if Some(X) and get rid of the let, it makes more sense. Basically, if it falls through the match statement to the default (since match has to exhaustive), that is falsey so it goes into the else branch. I've not used match in Python but from PEP 636 it doesn't look like it has to be exhaustive in python
Indeed, the wildcard match seems to be optional in python
 
7:09 AM
IIRC --strict complains about non-exhaustive match in Python, but otherwise no.
 
 
5 hours later…
12:09 PM
@roganjosh Does it help you to know this is an assignment from a ternary? So the way you would do a if (a := foo.bar.get("qux")) is not None else [] in Python with its do-if-else order, you have if let Some(a) = v {a} else {[]} in languages that use if-do-else orderng.
@Aran-Fey I think you are supposed to, but none of the arguments for that have been convincing for me.
 
 
2 hours later…
2:00 PM
@MisterMiyagi I think so. From this bit of chatter I think I've rubber-ducked myself into following the logic. I still find it a bit mentally-jarring regardless with the use of "let" with two "=" because that signals my thoughts into "there's an assignment here" but obviously with the ternary, that might never be
I actually think the python assignment expression syntax wins out here
 
 
3 hours later…
5:12 PM
Switched to linux (again) for a day and (again) spent the whole day searching for, reading, and altering various text files because apparently linux has never heard of GUIs or user-friendliness
Me: "Install vscode"
Linux: "Install vscode and make it the default app for opening folders, got it"
Me: "... hey google, can you help me out here? Yeah, he did it again. Yes, this is the 3rd time"
 
5:26 PM
wat
 
That ^
 
when I have to edit text config files it's typically because it's assuming too little about what I want to do rather than too much.
 
@Aran-Fey I mean, it depends on the distro. Sounds to me like you're using a GUI file manager and the MIME type has been changed too. This is related: unix.stackexchange.com/questions/578248/…
 
"!!!!! I don't know if this will work with other Distros then Linux Lite !!!!!" Good god
 
5:42 PM
I mean, in a way they are right, but also, not really. This mostly depends on the file manager and how the MIME type is updated by the application (vscode). So you can fix this problem or even not find it on other distro easily
see this is why I always do file management in the terminal 🤷‍♂️ it's just less hassle but maybe that's just me
 
6:21 PM
Linux is made out of too many small puzzle pieces, there's always friction somewhere
 
6:43 PM
True, but that could be applicable to most things...there probably at least one thing that break at least once in an entire year when it comes to software stack, even outside linux
everything is either badly made, decently made but misses key features, or work just well enough until you need something to fix or an additional feature.
 

« first day (4935 days earlier)      last day (13 days later) »