camelCase variables are forbidden by the compiler to eliminate bikeshedding over naming conventions, but the current error doesn't communicate that at all:
error: Syntax error
โโ /.../thing..gleam:115:18
โ
115 โ pub fn overlappedBy(compare: fn (a, a) -> Order, a: Interval(a), b: Interval(a)) -> Bool {
โ ^^ I was not expecting this.
Expected one of: "("
It'd be good if the error explained why this is a syntax error, if you're coming from most other languages this will be quite confusing otherwise. I suggest:
error: Syntax error
โโ /.../thing..gleam:115:18
โ
115 โ pub fn overlappedBy(compare: fn (a, a) -> Order, a: Interval(a), b: Interval(a)) -> Bool {
โ ^^ I was not expecting this.
Gleam only allows lowercase letters and underscores in variable and type names. Try:
overlappedby
overlapped_by
Maybe with a little hint explaining its to avoid arguments over naming styles.
Good idea! Thank you
Great suggestion. What do y'all think about:
error: Syntax error
โโ /.../thing..gleam:115:18
โ
115 โ pub fn overlappedBy(compare: fn (a, a) -> Order, a: Interval(a), b: Interval(a)) -> Bool {
โ ^^^^^^^^^^^^ This is not a valid name.
Hint: In Gleam names must start with a lowercase letter and contain only lowercase letters, numbers, and '_'.
Try: overlapped_by
For the Try: I'm thinking calling .snake_case() is probably good enough.
That looks perfect, let's do that
I'm working on this! I'll throw up a patch shortly.
Most helpful comment
That looks perfect, let's do that