« first day (3 days earlier)      last day (59 days later) » 

3:33 AM
@user ? is the ternary operator
if its and identifier i can do:
val even? = x -> x % 2 == 0;
which is better than is_even imo
 
 
5 hours later…
8:33 AM
@PyGamer0 do you not have if else?
In a functional language those would be expressions
@PyGamer0 i see
If it doesn’t complicate parsing I don’t see anything wrong with it
Just not the most useful feature though
 
 
2 hours later…
10:39 AM
@user no
just have ?:
because this is an expression only language
and similarly i also dont have loops
 
10:56 AM
Why not use if then as expressions tho?
Much, much clearer
Not to mention easier to parse
 
11:15 AM
@user ...
in The Nineteenth Byte, May 31 at 5:34, by PyGamer0
in Wellscripted, 8 secs ago, by PyGamer0
CMP: Which is better for conditional evaluation: ?: or if else
 
Well I'd like to vote for if foo then bar else baz
 
11:29 AM
@user how about python's bar if foo else baz ?
 
12:22 PM
Eww
 
12:53 PM
@user bruh
i dont like the then
 
Then you could do if (foo) bar else baz
 
that is a long winded way of the C style
 
1:14 PM
i will just use the haskell one
 
 
2 hours later…
3:32 PM
val collatz = (n: Integer) -> {
    var ar = [];
    while (n > 1) ar.push(n =
        ar % 2 ?
        1 + 3 * n :
        n / 2
    );
    return ar;
}
 
4:07 PM
hold on, what is ar % 2 doing there, the modulo of an array doesnt make much sense to me
 
also yes, i perfer cond ? code : code to if (cond) code else code
 
is it implicitly becoming the last item of the array?
i do feel that only having something like foo ? bar : baz as your conditional format might reduce code readability
 
i disagree
 
@des54321 frick i meant n % 2 lmao
val collatz = (n: Integer) -> {
    var ar = [];
    while (n > 1) ar.push(n =
        n % 2 ?
        1 + 3 * n :
        n / 2
    );
    return ar;
}
@des54321 that sounds like a good idea lol
 
having arrays sometimes evaluate to their last element might be a fun feature, but it feels more like something for rSNBATWPL than for this
 
4:11 PM
@Radvylf ^
obviously i cant ping him
so i did it in tnb
btw i think i have to test the lexer
which i will do tomorrow
i may put this in a github repo at some point
 
5:00 PM
@PyGamer0 I thought you weren't doing loops
Or mutability
Btw, you should take a look at Ocaml's syntax, there are some things there you might want to use in your lang
 
5:24 PM
@user oh dang i forgor 💀
 

« first day (3 days earlier)      last day (59 days later) »