News for hackers. Stuff that matters.
Re:Beautiful Binary Search in D by skocznymroczny on Saturday February 18, 2023 @12:49PM (#34849091)
Unless I am missing something, you can just use .length on a static array:

    int[5] a = [1,2,3,4,5];
    writeln(a.length); // 5
Re:Beautiful Binary Search in D by smcl on Saturday February 18, 2023 @01:22PM (#34849478)
Is that available at compile time, though?
Re:Beautiful Binary Search in D by mhh__ on Saturday February 18, 2023 @01:44PM (#34849732)
Yes
Re:Beautiful Binary Search in D by smcl on Saturday February 18, 2023 @09:10PM (#34853443)
Oh neat, I'm still a dlang noob and only used it in Crafting Interpreters :)
Re:Beautiful Binary Search in D by alex_muscar on Saturday February 18, 2023 @02:16PM (#34850074)
Someone on the D subreddit pointed that out as well. I didn't know it was available at compile time. I'll update the post. Thanks.