Re: GTK 3.20 Nim wrapper

2016-12-15 Thread vlad1777d
Thanks, all went normally, but I stacked with creating pixbuf from image. I decided to use this: [https://pp.vk.me/c638428/v638428447/13ff8/5by3ijiErV4.jpg](https://pp.vk.me/c638428/v638428447/13ff8/5by3ijiErV4.jpg) function, but I got an error:

Re: unescape \n \r etc in string

2016-12-15 Thread vlad1777d
@Krux02, maybe this is a bug, you could post an issue on GitHub.

Re: unescape \n \r etc in string

2016-12-15 Thread Krux02
no, I am asking for the inverse of that function. There is unescape, but it doesn't do what I want to do: import strutils let str = r"\n\r" echo str assert unescape(str, "", "") == "\n\r"

Re: Fun with rdtsc() microbenchmarks

2016-12-15 Thread Stefan_Salewski
Well, more meaningful and even more funny is this code with random numbers, where the compilers really can not remove the proc calls: import random proc rdtsc(): int64 = var hi, lo: uint32 asm """ rdtsc :"=a"(`lo`), "=d"(`hi`) """ result =

Re: unescape \n \r etc in string

2016-12-15 Thread cblake
Perhaps you want strutils.escape? I.e.: import strutils echo escape("\n\t") Output is "\x0A\x09" Its output is designed to be as portable an 'input' to de-escapers/escape-interpreters as possible. So you will see things like \x0A and \x09 instead of the \n \t because

unescape \n \r etc in string

2016-12-15 Thread Krux02
I have a macro with a string argument. The string is partially preserved, but all n from the string are now litterally n and t. so how do I unescape thesevalues to create a string object out of them? All my ideas right now feel like a lot of work with some uncertenty if I did everything