4 ms·
fk lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette> { wenn lass Etwas(wöbu) = gefährlich { WÖRTERBUCH.als_r
by michidk 11mo ago
fk lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette> {
wenn lass Etwas(wöbu) = gefährlich { WÖRTERBUCH.als_ref() } {
Gut(wöbu.hole(&schlsl))
} anderenfalls {
Fehler("Holt das Wörterbuch".hinein())
}
}
https://github.com/michidk/rost https://github.com/michidk/rost
- fainpul 11mo agoIndent with two spaces for code formatting.
- yohbho 11mo agofk lese(&selbst, schlsl: Zeichenkette) -> Ergebnis<Möglichkeit<&Zeichenkette>, Zeichenkette> { wenn lass Etwas(wöbu) = gefährlich { WÖRTERBUCH.als_ref() } { Gut(wöbu.hole(&schlsl)) } anderenfalls { Fehler("Holt das Wörterbuch".hinein()) } } isn't the idea behind programming "languages", that they are sentences readable to both humans and the compiler? This absolutely is not readable to me. But woerterbuch and schluessel should of course not be abbreviated, for legibility.
- ahartmetz 11mo agoIf German was seriously used in programming languages, I'd hope for some better and shorter terms. Some here might be intentionally too literal translations anyway. "Let" is from mathematics, it's called "Sei" in German. "Sei x = 5". "Anderenfalls" could be "sonst". "Zeichenkette" is just too long and would require some thinking or a historical accident to find a shorter term. Ready surprisingly nice to me anyway.
- b3orn 11mo agoI would use "sei" instead of "lass" for "let" to be more in line with notation in mathematical proofs.
- croemer 11mo agoI don't like the non-Germanic ref here in als_ref is not Germanic enough. als_ver (from Verweis) would be nicer.
- ahartmetz 11mo agoAs a non-Bavarian German, I'm offended by the German = Bavarian stereotype! (jk, it's just mildly annoying sometimes and this is meant to be silly)
- fransje26 11mo agoAlmost perfect. I'm missing the Schwabacher typeface rendering.