[RFC] Adding @ prefix (or similar) to import

2018-04-26 Thread JohnAD
As we all know, nim seperates the procedures that operate on an object from the data of the object itself. I understand the thinking and largely agree with it. However, a side-effect of this is that when importing an object from a module, it is difficult to control what is being imported. Such c

Re: cannot call a proc without brackets

2018-04-26 Thread Araq
"anti UFCS fire"? There is no UFCS involved here. "vexing parse" also has nothing to do with it. Hate what you want but an informed opinion can't hurt either.

Re: MPFR library wrapper for Nim

2018-04-26 Thread smitty
No, not aware of any. Tried these?: [https://nimble.directory/search?query=gmp](https://nimble.directory/search?query=gmp)

Re: libui.dll?

2018-04-26 Thread Araq
A long program startup is often caused by an antivir program.

Re: string change from 0.18.0 on?

2018-04-26 Thread miran
> the rationale is Python Python's ranges have upper limit excluded, while Nim has upper limit included. To mimic Python's range, use `..<`.

Re: string change from 0.18.0 on?

2018-04-26 Thread matkuki
@miran certainly, the rationale is Python: myString = "Some String" print(myString[0 :]) # echos "Some String" print(myString[0 : -1]) # echos "Some Strin" That issue you linked explains it, thanks. I will mark this as solved.

libui.dll?

2018-04-26 Thread dangdongho3
I use the UI0.9 module examples, compiled by release model program, first run in the windows environment, you need to wait a few seconds before they can be displayed. And the interface with IUP compiler module does not have this problem. It's weird.Is there a problem with libui.dll?

Re: string change from 0.18.0 on?

2018-04-26 Thread miran
> I had the same code from pre-0.18.0 and it worked with ^0, This reminds me of [this issue](https://github.com/nim-lang/Nim/issues/7444). The previous behaviour, where null terminator is ignored, is just wrong. You should change your program and use `^1` for the last character. * * * Btw, sin

Re: cannot call a proc without brackets

2018-04-26 Thread Udiknedormin
Why not just treat `discard` like a function call which takes another function call? Then `discard fun x, y` would parse as `discard(fun(x), y)`, just like with, say, `echo`. Then it just makes sense.

MPFR library wrapper for Nim

2018-04-26 Thread cdome
Hi Nim Community, Does anyone aware of usable MPFR library wrapper for Nim? I fail to find it in the packages repo. Thank you

Re: string change from 0.18.0 on?

2018-04-26 Thread matkuki
Thanks @Krux02, I had the same code from pre-0.18.0 and it worked with **^0** , then recompiled it with 0.18.1 and it added the terminator, that is why I was confused. Then it seems to be a change? Sorry again for the mistake guys.

Re: string change from 0.18.0 on?

2018-04-26 Thread Krux02
well you have a bug in your code, `^0` actually indexes the 0 terminator of a string, and this behavior is correct. Use `^1` instead.

Re: string change from 0.18.0 on?

2018-04-26 Thread matkuki
Sorry, my mistake! I showed the wrong code, it should be: var myString = "Some String" echo "'", myString[0 .. ^0], "'" Sorry guys! Is this a regression?

Re: string change from 0.18.0 on?

2018-04-26 Thread Araq
Tested on Windows 10 x64, Nim 0.18.1 x64, works for me, no binary zero / space.

Re: cannot call a proc without brackets

2018-04-26 Thread lightness1024
it took me a good minute to understand what you said @mashingan. That is a vexing parse in my opinion, and only some more gasoline on my anti UFCS fire. It's sad that I end up with negative judgments of a feature that sounds so marvelous on paper. (and I like the command call syntax, spaces with

Re: string change from 0.18.0 on?

2018-04-26 Thread matkuki
Thanks @miran, It may have been introduced in one of the mid 0.18.0 versions, because I tried it again on a friends **Windows 10 x64, Nim 0.18.1 x64** machine and the error is present. @miran, could you perhaps try it with a newer version of Nim? Thanks

Re: string change from 0.18.0 on?

2018-04-26 Thread miran
Windows, version 0.18.0: 'Some String'

Re: Perfecting Nim

2018-04-26 Thread arnetheduck
Araq, `{.experimental.}`, that's an exceptionally (haha) pragmatic and likable plan! Even the exceptions are fine with an exception-free core because that makes a no-exceptions flag quite feasible in the future, when a better option emerges. What about the crufty / obsolete / inconsistent stuff

Re: string change from 0.18.0 on?

2018-04-26 Thread matkuki
Can someone with Windows please confirm the error, please?

Re: string change from 0.18.0 on?

2018-04-26 Thread amalek
Works for me too. Just tested it on Void Linux x64, with Nim 0.18.1 (recompiled a few hours ago with choosenim).

string change from 0.18.0 on?

2018-04-26 Thread matkuki
Pre 0.18.0: var myString = "Some String" echo "'", myString, "'" # --> echos 'Some String' Post 0.18.0: var myString = "Some String" echo "'", myString, "'" # --> echos 'Some String ', notice the space (null character) Is this here to stay or a reg

Re: string change from 0.18.0 on?

2018-04-26 Thread Araq
Weird regression. Works for me on OSX.

Re: callsite()

2018-04-26 Thread Araq
macro styledEchoPrint*(m: varargs[untyped]): typed = ## partially lifted from an earler macro in terminal.nim and removed new line result = newNimNode(nnkStmtList) for i in countup(0, m.len - 1): result.add(newCall(bindSym"styledEchoProcessArg", m[i])) result.add(newCall(bindSym"write", bindSym

callsite()

2018-04-26 Thread qqtop
I see warnings that callsite() is being deprecated. I use this macro and would like to know how to rewrite it without using callsite() to achieve the same effect. macro styledEchoPrint*(m: varargs[untyped]): typed = ## partially lifted from an earler macro in terminal.nim and

Re: Perfecting Nim

2018-04-26 Thread Araq
@didlybom The names follow [https://nim-lang.org/docs/apis.html](https://nim-lang.org/docs/apis.html) (a document that is not well known). `initT` is used for value-based types, `newT` for pointer-based types. `newSeq` and `newString` depart from it because they were created early on.

Re: Perfecting Nim

2018-04-26 Thread didlybom
One small thing that feels inconsistent in the standard library (and which has confused me a bit since I started using nim) is that in addition to the new keyword different standard library classes have different new and/or init procedures. For example there is newSeq and newSeqWith, newTable, n

Re: Perfecting Nim

2018-04-26 Thread honhon
@Araq sounds like a good plan to me. If that plan was implemented would it be feasible to launch V1 by end of June? I think v1 plan should be a plan that allows v1 launch this year. If Nim used Swift release strategy it would probably be version 11 by now.