Re: why var can not be declared this way?

2018-11-08 Thread miran
> I am using python In Python variables are allowed to exit the scope of the loop/conditional where they're defined. For example: for i in range(5): print(i) print(2*i) # prints 8 Run In Nim these kind of things are not allowed, as others have already

Re: Error: implicit object field construction requires a .partial object, but got wMyFrame:ObjectType

2018-11-08 Thread Ward
I develop wNim without any OOP-extensions. However, it's is truely OOP in nim's way. I am not opposed to any OOP-extensions for nim. But It's better for anyone to understand what the extensions does in the backend. BTW, your first code is _Inheritance_ (wMyFrame is a wFrame), second code is _Co

Re: Error: implicit object field construction requires a .partial object, but got wMyFrame:ObjectType

2018-11-08 Thread oyster
Aha, thanks. I have just found [https://github.com/jyapayne/nim-extensions](https://github.com/jyapayne/nim-extensions) and rewrite the code. Now it seems that there is no much difference between nim-extensions version and your type version, but nim-extensions version can be understood easily f

Re: Error: implicit object field construction requires a .partial object, but got wMyFrame:ObjectType

2018-11-08 Thread Ward
Try this. {.this: self.} import wNim type wMyFrame = ref object of wFrame mWhichButton: int panel: wPanel bt1: wButton bt2: wButton proc final(self: wMyFrame) = wFrame(self).final() proc init(self: wMyFrame, ti

Re: How can I compile for DOS?

2018-11-08 Thread Ward
You can try "HX DOS Extender". It maybe works, but I had not tried yet.

Re: why var can not be declared this way?

2018-11-08 Thread oyster
thanks anyone. I am using python in which def f(size=1): if size == 1: widFrame = 320 hiFrame = 200 else: widFrame = 3200 hiFrame = 2000 print(widFrame, hiFrame) f() Run will says

How can I compile for DOS?

2018-11-08 Thread VGA
I fiddled around a bit and got an error about the memory manager needing to be ported to that platform. Is the error really the reason I cannot compile to DOS? (I didn't legitimately expect it to work, just playing around)

Re: Proper compiler options for release build

2018-11-08 Thread VGA
Ah, thanks, now I created a batch file containing nim c -d:release --opt:size --passL:-s %1 and just use that one from the cmdline. I guess you can put a pause as a second command and drag'n'drop nim a file on it.

Re: the v0.19.1 => 0.19.9 jump should've been v0.19.0 => 0.20.0

2018-11-08 Thread dom96
Probably could have worded that better. I'm fine, just missing the student life :)

Re: Can not pass static[string] to macro

2018-11-08 Thread Araq
Within the macro a `static[T]` is an expression of type `T`, that's why it doesn't work.

Re: Can not pass static[string] to macro

2018-11-08 Thread sk666
you are right, it should work. i too have been trying to get a macro to process variables without success. perhaps a experienced member can let us know where we are going wrong.