Attempting to use newContext from std/net fails to compile

2024-01-09 Thread Zectbumo
Another way is to include {.define: ssl.} at the top of your .nim file.

Attempting to use newContext from std/net fails to compile

2024-01-09 Thread Yardanico
Yeah, `nim.cfg` is just an older config format, both work of course.

Attempting to use newContext from std/net fails to compile

2024-01-09 Thread widlet
Figured it out not long after I posted. Thank you very much for your response. What I ended up doing was making a `nim.cfg` file at the project root with `-d:ssl` in it. I think this achieves the same thing as what you proposed. Now I can compile and my LSP stopped throwing errors and the `newCo

Sum types, 2024 variant

2024-01-09 Thread ElegantBeef
One noteworthy thing is that in the `case` assuming each branch label emits a distinct type(like my package fungus does ) you can dispatch on those types type Shape = case of Circle: r: int of Triangle, Square: w, h: int proc area(circ: Circle): int = circ.r * ci

Sum types, 2024 variant

2024-01-09 Thread blackmius
I prefer the @treeform way for sum types. it looks like it should work already in language. good intuitive way. for whom thinks extra “kind” field is overhead can make macros macros extracting kind enum and making boilerplate

Attempting to use newContext from std/net fails to compile

2024-01-09 Thread Yardanico
You need to compile your program with `-d:ssl` in order to use SSL stuff. If you also want the errors to not show up in VSCode, create a file named `config.nims` and put this there: switch("define", "ssl") Run

Sum types, 2024 variant

2024-01-09 Thread xigoi
How about making the `as` optional if you just want to shadow the variable, plus automatic dereferencing? proc traverse(n: ref Node) = case n of BinaryOpr: traverse n.a traverse n.b of UnaryOpr: traverse n.a of Variable:

Attempting to use newContext from std/net fails to compile

2024-01-09 Thread widlet
Hello all, I am currently trying to send an HTTP request using `std/httpclient` but in my development environment I need to ignore ssl errors. I understand that in order to do this I need to pass in a custom `SslContext` to the `HttpClient` used to make the request. I've written the following p

=destroy and enum

2024-01-09 Thread ElegantBeef
You should be able to do var myVariant = Object(kind: ...) let newKind = YourNewKind copyMem(myVariant.kind.addr, newKind.addr, sizeof(YourKindType)) Run

`nph` opinionated formatter v0.3

2024-01-09 Thread freeflow
NO worries. I've looked at nph and have now dumped it. The two space tabbing is too small for my aged and decrepid eyesight.

`nph` opinionated formatter v0.3

2024-01-09 Thread morturo
May be consistent but is ugly af.

`nph` opinionated formatter v0.3

2024-01-09 Thread auxym
Myself and @xigoi commented in a previous thread I believe. For me, I think it's mostly a matter of consistency with other infix operators (1 + 1 rather than 1+1).

`nph` opinionated formatter v0.3

2024-01-09 Thread arnetheduck
> What you are learning is that nph should not be enforcing a style but rather > a view. i.e. nph can take nim however it is written and then present it in > the ide in a format preferred by the user. I'd recommend to better understand what `nph`

`nph` opinionated formatter v0.3

2024-01-09 Thread freeflow
What you are learning is that nph should not be enforcing a style but rather a view. i.e. nph can take nim however it is written and then present it in the ide in a format preferred by the user. Using this approach it does not matter how much people disagree on a specific format because everyon

`nph` opinionated formatter v0.3

2024-01-09 Thread arnetheduck
Quite a few people have provided feedback that `1 .. 3` and `1 ..< 3` should have spaces to match all the other operators while NEP1 says they shouldn't. I've seen both styles in the wild but obviously because `nph` removes the spaces, those wanting their spaces back have been more vocal. Who ca

=destroy and enum

2024-01-09 Thread gcao
Thank you! That makes sense. A related question is how do I initialize the `kind` field in a newly-allocated memory, without triggering the destroy? I couldn't find a way to set memory directly. [Here](https://github.com/gcao/gene/blob/f3ecf762371d91faf58acfb875e1728b9e98ec82/src/gene/types.nim

can't run nim

2024-01-09 Thread ringabout
Yeah, please help us with reporting false postives to AV vendor

can't run nim

2024-01-09 Thread SergeyR
Hello! in August 2023 I installed Nim 2.0.0 and it wasn't problem. But now when I try to install Nim 2.0.2. Windows10 Defender do not allow the installation. although Firefox Downloader do not allow too. Scoop can't update my installation cause the Windows10 Defender.

Restore Sexual Power CBD Gummies Cost US Confided in Male Improvement!

2024-01-09 Thread hojiuti
Restore Sexual Power CBD Gummies Cost US Audits - Trick or Confided in Male Improvement CBD Sticky Brand? ✅✅ Visit the authority Restore Sexual Power CBD Gummies Cost US site to know more ✅✅ ✅✅ Visit other websites✅✅

why nim don't allow it ?

2024-01-09 Thread janAkali
proc draw(x: static[int] = 3) = discard #proc draw(x: static int = 3) = # alternative syntax # discard draw[42]() # compiles draw() # compiles too Run

Sum types, 2024 variant

2024-01-09 Thread didlybom
I have the opposite reaction to @treeform. I think it is great that a new syntax is being proposed because I find the fact that you must manually define a "kind" type super annoying (to the point that I never use object variants). IMHO code that uses them looks much more complex than the typical

Norm select from specific table_schema

2024-01-09 Thread nimian
Do you have any idea @moigagoo? :-(

why nim don't allow it ?

2024-01-09 Thread Chronos
What is the syntax for this, then?