=destroy for files and sockets

2022-04-09 Thread huantian
What exactly should happen if close raises an exception? I’ve never handled any exceptions for it before

=destroy for files and sockets

2022-04-09 Thread Araq
Huh good point, we really should have done that. PRs are welcome. However! It's a bit tricky because `close` can raise an exception.

What Business or Company Do You Most Admire?

2022-04-09 Thread sabrina0211
The transparency and corporate culture they have is Whatsapp Mobile Number List amazing. And part of the reason I admire them so much is because of their dedication to providing a great experience for their customers. When I started blogging, there was a lot of hype around social media and that'

Creation of Variant Types with Table Members

2022-04-09 Thread jwatson-CO-edu
Your answer is extremely helpful. It was not clear to me from reading the tutorials and docs that instantiating a type object with the fields only partially defined was even possible! Thank you for your insight and patience.

How to render html after a refresh on a specific url

2022-04-09 Thread masahiro
Thanks for the reply. The second method matches and I will proceed with the implementation that way! Thanks for the quick reply.

=destroy for files and sockets

2022-04-09 Thread cordillera
First I'll say I just started learning nim and used it for part of a small project and it was a joy to program in, a lot shorter and simpler to do the same tasks as it would be in c or c++ and still compiles to small and fast native code. My program was opening a lot of network connections, and

Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-09 Thread krakengore
I have a hard time understanding how i can make it work (mainly because of my limited knowledge here), imagine that i make a macro that will emit automatically an inherited class and implement those virtual functions in c++ so i can then wrap them in a nim object and "set" them via function poin

Lexim -- Regular expressions and lexer generation for Nim

2022-04-09 Thread Araq
I ported some Nim code to 1.6 that I wrote 7 years ago: Lexim is: * Poorly structured. Sorry. * Undocumented. Sorry. * A pure Nim regular expression implementation that seems to be 10x slower than PCRE. It's based on optimal DFAs though and if I remember co

Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-09 Thread Araq
True but you can `importc` the type that you emitted just like any other C++ type.

Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-09 Thread krakengore
Yeah i see, the problem i have with emit is that the emission happens once in the translation unit, but then the type might be referred to in the generated stdlib cpp which has no visibility on the emit in the other generated cpp file...

Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-09 Thread Araq
It's a very unfortunate omission, I used the `emit` statement (which would contain the class declaration plus the overrides) in the past as a workaround.

Defining C++ Macros from Nim

2022-04-09 Thread Araq
You can do it like this: proc x() {.importcpp, header: """#define DEFINEHERE #include "header.h" """.} Run

Status of the incremental compilation feature

2022-04-09 Thread Araq
Progress on IC is coming along with the speed of a snail. Not because it's particularly hard but because bugfixes and minor feature improvements eat up all of our development resources. But in the meantime nimsuggest is receiving bugfixes.

Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-09 Thread krakengore
This is more or less what i'm trying to achieve: foo.h: struct Foo { virtual ~Foo() = default; virtual void bar() {} }; inline void processFoos(Foo* foo) { foo->bar(); } Run test.nim: type Foo {.

Result of applying high()/low() to a range typedesc

2022-04-09 Thread dxb
> Also, range types are implicitly convertible to their parent ones, so it's > not such a big deal: Acknowledged, thank you for the reply! :D

my TUI designer.

2022-04-09 Thread JPLRouge
**stable TUI :** _My last tests aimed to make it function like on the OS400, as well as having the same simplicity and additional functions._ images for example in the PROJECT folder Reading the code is simple: we only deal with data management, screens and fields the grid ect is managed automa

Result of applying high()/low() to a range typedesc

2022-04-09 Thread Yardanico
I think it's the right thing to do, since `high`/`low` are used for example for enums: type MyEnum = enum Small, Medium, Large echo low(MyEnum) echo high(MyEnum) Run

Result of applying high()/low() to a range typedesc

2022-04-09 Thread dxb
Hi! I tried defining a range as type and then used `high()` and `low()` to get the interval's upper and lower bounds. I found that `high()` and `low()` return a range type value while I would have expected the return value to be of the type of the underlying ordinal type for the range's bounds.

Creation of Variant Types with Table Members

2022-04-09 Thread Yardanico
If I understood your question correctly, it's because you can't change the discriminant (branch) of an object variant at runtime. If you have something like: new(result) result.kind = FUNC Run It'll try to change the `kind` at runtime, and fail, because this behav

How to render html after a refresh on a specific url

2022-04-09 Thread enthus1ast
I guess your browser side routing works by rewriting the url. This works but the browser do not send a http get to the url, but just rewrites the url. When a refresh occurs, the browser sends a http get to the rewritten url (which does not exist). So you have a few options now: 1. rewrite th

Possible workarounds for subclassing a c++ class and overriding a virtual method

2022-04-09 Thread krakengore
That's a clever trick, thank you! It still require i have a c++ class tho, not sure if i can have an imported c++ class as {.inheritable.} with a virtual method and inherit from it in a nim object of and use the exportcpp trick to override the virtual method (because at that point it is a nim ob