Using Unicode in procedure and variable names

2023-07-24 Thread Araq
> What if they later want to allow chessboards o| different sizes? seq[seq[T]] > has overhead over a flat seq. Good one. Chessboards are 8x8 and an `array` is not a `seq`.

Using Unicode in procedure and variable names

2023-07-24 Thread hugosenario
> I have not seen others use Nim this way, what examples are there? from std/random import randomize, sample randomize() type ✊🤚✌️ = enum ✊, 🤚, ✌️ 🏆 = enum 👈, 🤷, 👉 proc `>`(👤, 👥: ✊🤚✌️): bool = 👤 == 🤚 and 👥 == ✊ or

Using Unicode in procedure and variable names

2023-07-24 Thread ElegantBeef
It's not too bad too type unicode on X11, it's just ctrl + shift + u followed by the value. But truthfully who needs anything but '‽'‽

Using Unicode in procedure and variable names

2023-07-24 Thread xigoi
What if they later want to allow chessboards o| different sizes? `seq[seq[T]]` has overhead over a flat `seq`.

Using Unicode in procedure and variable names

2023-07-24 Thread Araq
The unicode is fine but `array[0..63, Piece]` should be `array[8, array[8, Piece]]`. Don't worry about the nesting, it has no overhead.

Using Unicode in procedure and variable names

2023-07-24 Thread demotomohiro
When we talk about unicode in Nim code, someone usually complain that they don't have a keyboard to type unicode. So I introduce a nice Vim command to type unicode characters. :abbreviate king ♔ Run Then, when you type 'king' and an non-alphabet character, it automatically

Using Unicode in procedure and variable names

2023-07-24 Thread ElegantBeef
Due to how Nim does operators only a few unicode characters will be reserved to operators, the rest will just be normal identifiers. Documented here:

Using Unicode in procedure and variable names

2023-07-24 Thread koistinen
In I am using the unicode flexibility Nim allows: type Piece = enum ♚ = -6, ♛, ♜, ♝, ♞, ♟, □, ♙, ♘, ♗, ♖, ♕, ♔ type Pos* = object # 64 bytes bd: array[0..63, Piece] g50: int side: int ep:

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread Araq
> Nim had braces, was removed because no one used it for several years. Almost. It was used within a company though which was writing commercial software in Nim. I decided to remove it because the grammar and parser are evolving and a brace mode makes that more difficult.

Nim grammar top-level stmt vs complexOrSimpleStmt

2023-07-24 Thread khaledh-nim
Thanks for confirming. I submitted a [PR](https://github.com/nim-lang/Nim/pull/22325) to fix the docs.

Call to parameterized protected constructor of a base class when interop with C++

2023-07-24 Thread jmgomez
In 2.0 and `devel` you can use the expanded `constructor` pragma. There is a similar example in the docs:

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread mratsim
I don't see what Ada version of 6502 has over Nim's, see type # Note using uint8 instead of machine word size will add zero-extending overhead at every load CPUStatusKind* = enum

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread juancarlospaco
Nim had braces, was removed because no one used it for several years.

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread grd
> It has a few issues that would make experienced developers hesitant to adopt > it. IMO the only problem that Nim has is the lack of network effect But if you think that your arguments are valid, you can always fork.

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread r3c
"The lack of namespaces in Nim" is like saying "The lack of pointers in C"

Some of Nim's convention needs to change in order for it to succeed

2023-07-24 Thread xigoi
> increases the cost of learning (The learner must first know that > "indentation" means to have more spaces at the start of a line, before > learning further) I vaguely remember that when learning programming, I found braces more confusing than indentation. > and the cost of restructuring the

Call to parameterized protected constructor of a base class when interop with C++

2023-07-24 Thread NikeKhin
Hello, the point is how to wrap a C++ base class with non-default protected constructor. Pure C++ use case is class Base{ protected: Base(string name){ } }; class Derived : public Base { public: Derived(string name) : Base(name){ } };