why does Nim source code filter add a newline at the end of the last line?

2023-05-20 Thread ITwrx
Ok, after your last post, i looked back at the docs page, and it's much more obvious than it was to me this morn... Sorry for the trouble. Thanks

why does Nim source code filter add a newline at the end of the last line?

2023-05-20 Thread Araq
How would you generate shell script code without these newlines? SCF is not just for HTML and the newlines simply make sense, it's like asking "why do triple quoted strings keep the newlines?", well because that's the point of them.

why does Nim source code filter add a newline at the end of the last line?

2023-05-20 Thread ITwrx
I probably should have put "having to" in quotes, as it was meant as a casual reporting of what i was doing, as opposed to a big, serious complaint, but i'd rather not look at, or add boilerplate to remove, unnecessary newlines or whitespace i didn't purposely add in html i am generating myself.

Teach you to write nim code comfortably use vim if you like vim you must try :)

2023-05-20 Thread cmc
Works great, using it now

Teach you to write nim code comfortably use vim if you like vim you must try :)

2023-05-20 Thread demetera
Thanks for the updates. For auto-completion (based on nimsuggest) and linting I was using this setup: call plug#begin() "Autocompletion Plug 'alaviss/nim.nvim' Plug 'prabirshrestha/asyncomplete.vim' #Linting and syntax Plug 'baabelfish/nvim-nim' Plug

why does Nim source code filter add a newline at the end of the last line?

2023-05-20 Thread Araq
HTML works fine with optional whitespace, you don't have to strip it. But you can also use a templating system more to your liking, there are a couple around.

Error: expression has no type (or is ambiguous)

2023-05-20 Thread ITwrx
Thank a lot! Yes, it is from strutils. The following code works. var returnString = genImageLink(link, title, imageFilename, altText) let strippedString = returnString.dup(strutils.stripLineEnd) return strippedString Run

Error: expression has no type (or is ambiguous)

2023-05-20 Thread z_____________
If that's [stripLineEnd from std/strutils](https://nim-lang.org/docs/strutils.html#stripLineEnd%2Cstring), it operates in-place and doesn't return anything. Consider using it with [dup from std/sugar](https://nim-lang.org/docs/sugar.html#dup.m%2CT%2Cvarargs%5Buntyped%5D).

why does Nim source code filter add a newline at the end of the last line?

2023-05-20 Thread ITwrx
from: Example: The filter transforms this into: "\n") Run why should that last newline be added automatically? Now, i'm having to ([try](https://forum.nim-lang.org/t/5371)) and strip it (when returning html other t

Error: expression has no type (or is ambiguous)

2023-05-20 Thread ITwrx
my proc has a return type specified, yet i still get the same error. Error: expression 'stripLineEnd(returnString)' has no type (or is ambiguous) Run #calling code. var returnString = genImageLink(link, title, imageFilename, altText) let strippedString

Teach you to write nim code comfortably use vim if you like vim you must try :)

2023-05-20 Thread cmc
Cool love me some Nim-Vim tips

Malebogia

2023-05-20 Thread mratsim
Note that if you do IO, and you block while waiting for an event in-kernel, you will block Weave load balancing.

Malebogia

2023-05-20 Thread Araq
Benchmark results for my M1: Malebolgia: took 486 milliseconds, 285 microseconds, and 958 nanoseconds Weave: took 865 milliseconds, 11 microseconds, and 292 nanoseconds single threaded: took 1 second, 170 milliseconds, 708 microseconds, and 875 nanoseconds

Teach you to write nim code comfortably use vim if you like vim you must try :)

2023-05-20 Thread lf_araujo
I use neovim, but it seems to be compatible. Thanks!

I came across a strange behavior of httpClient with Uri type parameter

2023-05-20 Thread domogled
For http and https it makes the same error. At first I thought the problem was on my domain, which I was connecting to in my code. I ruled that out. You can change the domain in that example,. I've tried for example google.com and it makes the same error. It's not a problem, as far as I know. J

I came across a strange behavior of httpClient with Uri type parameter

2023-05-20 Thread Araq
Shouldn't the scheme be "https"?

Help with generics and typeclass problem

2023-05-20 Thread mratsim
> this compiles but I get SIGSEGV on executing It's strange, in my experience it's the nim compiler itself that SIGSEGV Anyway, it's a bug and should be reported in the tracker.

I came across a strange behavior of httpClient with Uri type parameter

2023-05-20 Thread domogled
four ways of the same program, one ends in an error. Why? I was surprised and unable to find out the cause. #!/usr/bin/env bash echo "compile with full url, will be OK" nim c -r -d:ssl --define:http ./devel.nim echo "compile with url and set scheme, will be ERR

Teach you to write nim code comfortably use vim if you like vim you must try :)

2023-05-20 Thread Angluca
You can test [vim-easycomplete](https://github.com/jayli/vim-easycomplete) If you want use vim write nim language Works well, can autocomplete functions variables macros ... How to install Plug 'jayli/vim-easycomplete' # vim plugs nimble install nimlsp # nimble # OK, you ca