45 ms·
If I understand you correctly, the convention is basically the following, right? class FooBar(): pass foo_bar = FooBar() The equivalent in Nim:
by dom96 11y ago
If I understand you correctly, the convention is basically the following, right?
class FooBar(): pass
foo_bar = FooBar()
The equivalent in Nim:
type FooBar = object
var foo_bar = FooBar()
Compiles and runs perfectly fine.
How can this be the case? Well, the identifier equality rules in Nim have changed a while back, to make the first letter of every identifier case sensitive. So, FooBar == Foo_Bar == Foobar, but fooBar != Foo_Bar.
- scardine 11y agoYou are right. Nim is not case insensitive anymore, it is case sensitive for the first letter. But in my defense, the last time I checked it used to be! Quoting from the wayback machine: > Nimrod is a style-insensitive language. This means that it is not case-sensitive and even underscores are ignored: type is a reserved word, and so is TYPE or T_Y_P_E. The idea behind this is that this allows programmers to use their own preferred spelling style and libraries written by different programmers cannot use incompatible conventions.