> 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
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
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
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
You can try "HX DOS Extender". It maybe works, but I had not tried yet.
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
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)
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.
Probably could have worded that better. I'm fine, just missing the student life
:)
Within the macro a `static[T]` is an expression of type `T`, that's why it
doesn't work.
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.
11 matches
Mail list logo