Sum types, 2024 variant

2024-01-10 Thread Araq
> also why not use OOP? Cause OOP sucks. Exhaustive pattern matching is in direct conflict with OOP's philosophy, requires `ref` indirections.

FrameOS

2024-01-10 Thread undefined
You said it correctly. It's the joy. It's addictive.

FrameOS

2024-01-10 Thread ITwrx
Way to be somebody! :) I repeated your recent blog post on the fediverse via my account on my activitypub/pleroma instance at blurts.net. Feel free to create an account there if you're not already on the fediverse. Same goes for all Nimians.

Custom constructors

2024-01-10 Thread demotomohiro
I tried to study about constructors in C++ before and I found that there are many complex rules in C++ constructor. I wonder if Nim can implement constructors that are simple and useful. I think calling a proc that initializes and returns

Bio Stamina CBD Gummies Pills To Lift Semen Volume And Quality!

2024-01-10 Thread neoikon
Bio Stamina CBD Gummies Pills To Lift Semen Volume And Quality!

Custom constructors

2024-01-10 Thread Clonk
Here are multiple ways of initializing an object : type Dollar = distinct float Transaction = object amount: Dollar = Dollar(3.0) proc `$`*(x: Dollar): string {.borrow.} proc `$`*(x: Transaction): string = $x.amount & "$" pro

`nph` opinionated formatter v0.3

2024-01-10 Thread ggibson
Isn't developer-specific preference -- such as two vs four space tabbing -- a developer-specific problem? I imagine `nph`, much like python's `black` to be used like a pre-git-commit automatic step to standardize code. Doesn't much matter what it's standardized to. This frees you up to display a

Custom constructors

2024-01-10 Thread ggibson
I'll assume for better or worse you are familiar with C++. Let's translate to C++ so it becomes obvious how Nim works differently. let d = 176.Dollar Run in c++ would be auto d = static_cast(176); // maybe dragons! Run in c++ what you wante

Nim v2: what would you change?

2024-01-10 Thread Clonk
This is something that should be handled by your IDE about how many tabs are inserted when you press tabs for .nim and .nims file.

Nim v2: what would you change?

2024-01-10 Thread ratandalez
I would also like using tabs for indentation without the #? replace(sub = "t", by = " ") first-line-stunt.

Custom constructors

2024-01-10 Thread lim1999
Dear All, Why there are no constructors in NIM? The reason I ask is that I see several instances where it would be very useful. Sure, one can resort to conventions like using a 'proc initTypename()' but that doesn't seem to be as convenient as using a constructor (or specific method like the _

Nim v2: what would you change?

2024-01-10 Thread hyu1996
Will we have an async iterator feature?

Sum types, 2024 variant

2024-01-10 Thread ElegantBeef
Pointer indirection and heap allocation make using OOP a very unfriendly choice. It's also `of` not `is` for checking inheritance :)

Sum types, 2024 variant

2024-01-10 Thread blackmius
also why not use OOP? type Node = ref object of RootObj BinaryOpr = ref object of Node a, b: Node UnaryOpr = ref object of Node a: Node Variable = ref object of Node value: string Value = ref object of Node value: int m