News for hackers. Stuff that matters.
Re:How to make your C codebase Rusty: rewriting keyboard fir... by rovolo on Thursday November 21, 2019 @07:01PM (#21601141)
I'm not sure this is the reason, but function types look better if you put the return type after the parameter types. Compare C to Kotlin:

    float (* f)(int);
    val f : (int) -> float;
    float[] (* map)(int[], float (*)(int));
    val map : (int[], (int) -> float) -> float[]
You could put the return type before the function, but then the type will look inconsistent with the function declaration:

    float[] map(int[] arr, (int) -> float f)
    fun map(arr : int[], f : (int) -> float) : float[]
So if you're passing functions around, it tends to look nicer if you always put the type after the variable/argument/function

There are no comments on this comment yet.