Re: How can I compile for DOS?

2018-11-15 Thread Libman
I'd just like to second this endeavor. I've always wanted to tinker with getting [djgpp](http://www.delorie.com/djgpp/zip-picker.html) (or one of the abandonware compilers) in dosbox to work with Nim-generated C89 code, but never found the time / energy. DOS support is the ultimate retroNerdCr

Macro that generates procs

2018-11-15 Thread bingobangobongo
Hi, I recently started toying with templates and macros in nim and even though they seem very powerful I haven't been able to correctly use macros yet. I'm trying to create a macro that would generate a proc with some fixed parts in its body when being called, something in the lines of (not work

Re: how to run vim and get output

2018-11-15 Thread Libman
Maybe you want something like: import os, osproc, posix, strutils proc userEditString(content = "", editor = "vim"): string = let tmpPath = getTempDir() / "userEditString" let tmpFile = tmpPath / $getpid() createDir tmpPath writeFile tmpFile, content

how to run vim and get output

2018-11-15 Thread curioussav
I already posted this on reddit [https://www.reddit.com/r/nim/comments/9x641g/how_to_run_vim_and_get_output](https://www.reddit.com/r/nim/comments/9x641g/how_to_run_vim_and_get_output)/ I was trying to use osproc to run vim and grab the text the user entered but it just crashes. le

Re: Error with Glew

2018-11-15 Thread treeform
Yeah that is the right idea. I think you did it very complicated. I would just put: {.emit:""" #include "GL/glew.h" #include "GLFW/glfw3.h" //glfw3 must be the last include """.} Run At the top of your main file.

Re: Why illegal storage access here ?

2018-11-15 Thread DTxplorer
Ok, thank you !

Re: Why illegal storage access here ?

2018-11-15 Thread Araq
`ref object` can still be nil and is for your case.

Re: Why illegal storage access here ?

2018-11-15 Thread doofenstein
since `Example` is a ref object, it default initialises to nil. You need to initialise it: type Example = ref object a:seq[string] # you can change it from var to let and still modify the memory the reference is pointing to, # though not reassign the pointer

Why illegal storage access here ?

2018-11-15 Thread DTxplorer
I tried to do a search but it's not helpful (the forum search should look in the titles first) type Example = ref object a:seq[string] var anExample:Example proc function(ex:Example, txt:string) = ex.a.add(txt) # " SIGSEGV: Illegal storage access. (A

Re: release: a current-runable, error-in-the-future msgbox for wNim

2018-11-15 Thread Araq
Hmmm I got summoned here. Libraries that don't follow Nim's conventions are bad but worse for Nim are non-existing libraries so go ahead and do what you consider the best solution. But fwiw, the reason why we make `foo_bar` the same as `fooBar` is that `foo_bar` shouldn't exist to begin with :P

Re: error: unable to create target: 'No available targets are compatible with this triple.

2018-11-15 Thread AchalaS
Issue is resolved. The issue was bcz the llvm-clang was crashing with clang in emscripten.