OSError errorCode is always 0

2024-08-19 Thread hyu1996
Looks like a bug. nim-#devel/lib/pure/osproc.nim:1123, It works properly after being modified to the following. code var error: cint let sizeRead = read(data.pErrorPipe[readIdx], addr error, sizeof(error)) if sizeRead == sizeof(error): raiseOSError(OSErrorCode(error),

tag effects differ

2024-07-29 Thread hyu1996
Thank you very much for your reply. allocChunk is an approach that enables users to customize their own allocator types. Regarding the issue with RootEffect, I solved it using a hack way, maybe this is a case of error, but it did solve my problem and no exceptions appeared in the tests.

tag effects differ

2024-07-29 Thread hyu1996
I have a problem and I don't know how to solve it. Can someone help me look at it? There seems to be a `RootEffect` here, I don't know how to remove it. import std/streams type Chunk = ref object ChunkAllocator = ref

StableSeq

2024-07-02 Thread hyu1996
ChunkList, ChunkSeq

NVIDIA uses Nim!

2024-04-01 Thread hyu1996
This is really good news. Today is not April Fools' Day, so I believe it is true.

This forum has an XSS injection vulnerability

2024-03-05 Thread hyu1996
issue

This forum has an XSS injection vulnerability

2024-03-05 Thread hyu1996
I'm not an expert on this, I just found this issue when I searched for the 'name block' keyword. My username and password were automatically filled into an illegal edit box by Edge browser, and I don't know if this will cause my username and password to be leaked. There's no way to upload an ima

This forum has an XSS injection vulnerability

2024-03-05 Thread hyu1996
Thanks for the reply, I'm glad you told me this, I tried to use discord as a free picture host.

Nim v2: what would you change?

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

proc/func/method: syntax

2023-11-16 Thread hyu1996
To be compatible with python, maybe we should change python. 😂

How to make custom linear containers automatically converted to OpenArray, like SEQ or Array

2023-08-31 Thread hyu1996
Thank you very much for your advice, you convinced me.

How to make custom linear containers automatically converted to OpenArray, like SEQ or Array

2023-08-31 Thread hyu1996
issue:

How to make custom linear containers automatically converted to OpenArray, like SEQ or Array

2023-08-31 Thread hyu1996
Sorry, this solution seems to have a strong side effect, it generates c code that calls autoToOpenArray twice. I can observe this phenomenon when I insert the echo statement in it. Reproducible example: type Slice*[T] = object firs

How to make custom linear containers automatically converted to OpenArray, like SEQ or Array

2023-08-31 Thread hyu1996
Turning on the views feature solves this problem. {.experimental: "views".} document:

How to make custom linear containers automatically converted to OpenArray, like SEQ or Array

2023-08-31 Thread hyu1996
I've tried using converter, but the compiler reports an error.

Easiest way to check for shift-left overflow?

2021-02-27 Thread hyu1996
import std/bitops let i: uint8 = 0b0001 func checkedShl(a: SomeInteger, b: int): SomeInteger = if countLeadingZeroBits(a) >= b: a shl b else: raise echo checkedShl(i, 7) echo checkedShl(i, 8) Run