« first day (92 days earlier)      last day (568 days later) » 

2:23 PM
@El'endiaStarman What do you think switch statements should look like?
This is something I feel like literally every language has done wrong. The only language that got even close to tolerable switch statements imo is Ruby :P
 
Do we even need them? (Well, no, but maybe they're good to have.)
haha
What do switch statements offer that if-elif chains don't?
 
They're usually DRYer since you don't have to repeat the variable name and you can reuse code via falling through
 
I'm not a fan of the default behavior of falling through though. I think it shoud break by default and we should have a \hop operator to fall through (nilaidc goes to the next case, monadic takes a label and goes to that?)
 
I think we could possibly come up with a better system for that, not just switch statements. For instance, regarding code reuse, there are four kinds of "overlaps" I can think of: 1) overlap at the start, 2) overlap at the end, 3) one case's code is entirely within another, and 4) one case's end overlaps with another case's start.
Oooh, I think the key ingredient would be to allow, explicitly, a way of executing multiple branches of a conditional (if/else or switch).
\switchmulti[x](A){
    #A's start
}(A or B){
    #common code; A's end and B's start
}(B){
    #B's end
}
 
2:54 PM
I like that, although I'm not sure the syntax should look like that
 
3:12 PM
Well yeah, the syntax needs to be better.
Oh, instead of A or B, let's do A, B.
I think the multiple branch execution idea could be pretty powerful in some contexts. What about simultaneous branch execution? That'd be a form of threading, though, and would probably end up being needlessly complicated...
Hmm. It could be nice to have blocks of code be threaded automatically. Basically, just say "I want this and this to run at the same time" and Pytek does the rest of the work.
 

« first day (92 days earlier)      last day (568 days later) »