How to privatize the proc of the inherited parent object?

2019-10-27 Thread javinyang
In c++ class Preant { public: void call() { } }; class Child : public Preant { private: void call(); }; Run In nim type Preant* = ref object of RootObj proc call*(this: Preant)

Erlang/Elixir NIFs for nim

2019-10-27 Thread wltsmrz
In case anyone else may be interested, I've produced bindings to Erlang NIF API ( [https://github.com/wltsmrz/nimler](https://github.com/wltsmrz/nimler) ). The bindings are fairly complete and tested--though properly exhaustive tests are TBD. It's my first project in nim. Ideally, I'd like this

Re: Write in *.txt file from variables values , with separate new lines.

2019-10-27 Thread Peter58
God ! It works perfectly. :-) Thanks. If i had like more values... i think about a loop (for...) isn't it ?

Re: Make Nim easier for the developer

2019-10-27 Thread edu500ac
Hi, AMoura, thats me again. I think that the main problem with computer languages is not lack of features. My major concern about computer languages is that most of them do not keep backward compatibility. I liked the _Yi_ text editor, which happened to be written in Haskell. Do you know why I q

Re: Make Nim easier for the developer

2019-10-27 Thread shashlick
Check out nimterop which aims to do what you mention in #1. Nim certainly is very effective at binding to any shared or static library and nimterop makes it more seamless. As always there's a long way to perfection but it is already capable.

Re: Write in *.txt file from variables values , with separate new lines.

2019-10-27 Thread kidandcat
[https://nim-lang.org/docs/streams.html#writeLine%2CStream%2Cvarargs%5Bstring%2C%5D](https://nim-lang.org/docs/streams.html#writeLine%2CStream%2Cvarargs%5Bstring%2C%5D) "Writes one or more strings to the the stream s followed by a new line. No length field or terminating zero is written." The ne

Re: Write in *.txt file from variables values , with separate new lines.

2019-10-27 Thread Lecale
You just have to add a n to var1, var2, and var3. At least, that's how I see it. Maybe there is a sexier approach.

Re: Make Nim easier for the developer

2019-10-27 Thread edu500ac
Hi, AMoura. I don't care about language popularity, university ranking and the like, specially the kind of popularity that one measures with tools, such as TIOBE index and Webometrics. Let me tell you why. Let us consider university ranking. There is a very low ranked university in Russia, whic

Write in *.txt file from variables values , with separate new lines.

2019-10-27 Thread Peter58
I can read my file, but cannot write in it, with every value per line... >>> Thanks to your help... import strutils let cont = readFile("values.txt") let val = cont.splitLines() echo val # result >> (OK) # # # echo "val1: ", val[0], " val2: ", val[1], " val3: ", val[2] # r

Make Nim easier for the developer

2019-10-27 Thread AMoura
Hello everyone, I use several languages in my work and with big libraries (OpenCV, GDAL). My main language is C++, I use Python to script and sometime Julia. I'm using Nim from 4 weeks for a personal project and I love it. I didn't write this post to talk about me but the future features that m

Re: Some questions about cligen

2019-10-27 Thread cblake
At present your best bet for your first style is to just have the wrapped `proc` receive a `seq[string]` and just test it yourself. Note though, that you aren't really getting much value out of any option parsing framework vs. just using `os.cmdLineParams()`. While it could be more elegant/auto

Some questions about cligen

2019-10-27 Thread enthus1ast
cligen ([https://github.com/c-blake/cligen/](https://github.com/c-blake/cligen/)) how can i do: ./proc call "1. positional required" "2. positional required" "3. positional optional" # eg: ./proc call "*" "cmd.ping" # eg: ./proc call "*" "os.shell" "ifconfig" --json

Re: Extract sprite data from old DOS game resource file?

2019-10-27 Thread JohnS
You'd probably get some high-quality responses from [https://www.reddit.com/r/ReverseEngineering](https://www.reddit.com/r/ReverseEngineering)

Re: Difference between two dates

2019-10-27 Thread cblake
If you need a larger range and only care about "dates" only, there is a pretty simple formula valid for all dates after 4800 BC in [http://www.faqs.org/faqs/calendars/faq/part2](http://www.faqs.org/faqs/calendars/faq/part2)/ question 2.16.1

Nim compiler produces misplaced warnings

2019-10-27 Thread edu500ac
I tried to program a Lisp-like sexpr for writing macros, as suggested by mratsim (Mamy Ratsimbazafy). Since I used symbol for tagging symbols, as in Ratsimbazafy's DSL, the compiler issued a warning that symbol is deprecated. It seems that the Nim compiler confused my use of the symbol identifie

Re: Requesting examples of macros in Nim

2019-10-27 Thread edu500ac
Hi, martsim. I tried to develop a Lisp like consp data structures for writing macros. I used your Domain Specific Language as a starting point. The experiment is far from a success, but I decided to share the results with you, maybe you can help me. Here is what I got: import os,

Re: Difference between two dates

2019-10-27 Thread Peter58
Good job... Quick and simply answer... Script work perfectly ! Thanks a lot :-)

Re: Difference between two dates

2019-10-27 Thread GULPF
Solution: import times let auj = now() let deb = parse("04-09-2019", "dd-MM-") echo (auj - deb).inDays Run Keep in mind that this assumes 24-hour days.

Re: Extract sprite data from old DOS game resource file?

2019-10-27 Thread matkuki
You are completely correct @cumulonimbus (sorry for the long silence). I am a complete beginner when it comes to assembly. But I've played around with the DOS debugging (in DOSBox) and here are my observations: * the executable is DOS MZ 16-bit format * the main executable seems to load **.

Difference between two dates

2019-10-27 Thread Peter58
Hi all... I'm looking for a simply way, to calculate the diff. between two dates ... in Days ! For example> import times let auj = format(now(), "d/MM/ -- HH:mm") # Today's date... let deb = parse("04-09-2019", "dd-MM-") #an 'older' date... echo deb.format("dd-MM-") Actually, the

Re: How to make C call nim function which returns a type contains a sequence.

2019-10-27 Thread Yoxem
Example .nim file: type HugeNum {.exportc: "HugeNum".} = tuple isNotNeg : bool num_seq : seq[cuint] proc fib(a: cint): cint {.exportc.} = if a <= 2: result = 1 else: result = fib(a - 1) + fib(a - 2) return resul

Re: How to make C call nim function which returns a type contains a sequence.

2019-10-27 Thread mratsim
Can you give the full example file? For C interop your type should also have the exportc pragma. You might also want to add byref or bycopy to the type to enforce one behavior or the other as by default Nim pass by ref if the struct is more than 3 words on the stack (24 bytes on x86-64) and by