Re: Working with ZIP files

2017-07-29 Thread Nox
Hmm... Looks like appending files with fmAppend or fmReadWriteExisting modes does not work, not sure why.

Re: What happened to term rewriting macro?

2017-07-29 Thread bpr
If you go to this [super secret site](https://nim-lang.org/docs/manual.html#term-rewriting-macros), you'll find what you're looking for.

Re: Working with ZIP files

2017-07-29 Thread Nox
Thanks, I will check it out. In meanwhile I've figured out how to use zipfiles. Just had to add: {.passl: "-lz".} I've downloaded precompiled zlib binaries because zlib.dll supplied with Nim is 32 bit for some reason. Also, right away I've found some problem in libzip.nim, it produced IO error

Re: What happened to term rewriting macro?

2017-07-29 Thread LeuGim
I hope there's no plans of deprecation/removal, docs are where there were, docs/manual/trmacros.txt.

Re: What happened to term rewriting macro?

2017-07-29 Thread LeFF
@LeuGim, I found old documentation, made an example and I see it working now, but I don't see any documentation about it... I thought maybe it is going to be deprecated or even removed completely at some point near 1.0 release or something... but to be fare it is a very neat feature, that I'm go

Re: What happened to term rewriting macro?

2017-07-29 Thread LeuGim
No, they work.

Re: Working with ZIP files

2017-07-29 Thread LeFF
try out miniz: [https://github.com/richgel999/miniz](https://github.com/richgel999/miniz) \- it is single file C-library, which can read/write zip files... I'm not sure if there is a ready to use Nim bindings, but it should be easy to make one yourself...

What happened to term rewriting macro?

2017-07-29 Thread LeFF
It seems that there is no documentation about it, but I remember that it was years ago. Was it removed from Nim compiler at some point?

Re: UDP socket closing after send

2017-07-29 Thread xyz32
This code works, thank you. Doesn't seem to be too much different then the other one, but it works. BTW Fedora labs have a "robotics lab" version that contains this server: [https://labs.fedoraproject.org](https://labs.fedoraproject.org)/ Cheers

Re: + won't take two different types

2017-07-29 Thread LeuGim
The way to go: type Addable = concept x, y x + y proc addit(a, b: Addable): auto = return a + b echo addit(12, 22.1) # -> 34.1 echo addit({1,3,5},{5,7}) # -> {1,3,5,7} * * * Yet you can explicitly convert arguments, this way you decide by yourself what

Re: + won't take two different types

2017-07-29 Thread mashingan
CMIIW, literal numbers would be converted to appropriate type which defined in [convertible relation](https://nim-lang.org/docs/manual.html#type-relations-convertible-relation) while `T` and `U` behave differently with primitive types.

Re: + won't take two different types

2017-07-29 Thread boia01
I'm not 100% sure but I'll note that removing the type parameters such as: proc addit(a: int, b: float): auto = return a + b still doesn't compile, it triggers the same type mismatch error due to the unavailability of a suitable + proc. So the reason isn't related to

+ won't take two different types

2017-07-29 Thread aedt
addit[T, U] (a: T, b: U): auto = return a + b proc main() = #echo addit(12, 22.1) #<\-- won't work echo(12 + 22.1) main()

Working with ZIP files

2017-07-29 Thread Nox
Hello, I want to use Nim on Windows to work with IDML files which contain bunch of zipped XML files packed in specific order (e.g. mimetype file comes as first and must be uncompressed). I've tried “Wrapper for the zip library” but can't get it to work. It looks like _libzip_ library is kinda

Re: UDP socket closing after send

2017-07-29 Thread mashingan
Yeah, as @Ar mentioned, no windows binary and I was too lazy to install libboost in my linux vm so I cannot experiment with rcss Anyway, I did some experiment with subscribing model using UDP, and I'm able to send the message to client repeatedly from server without client closing the

Re: UDP socket closing after send

2017-07-29 Thread xyz32
@Araq: I know it is sort of an Easter egg , I am enjoying it while I still can.

Re: What is missing for the seq/string types to be not nil by default?

2017-07-29 Thread Krux02
Thank you, and yes it is related. When I touch code of strings, everything becomes important.

Re: OOP Macro section of Nim by Example doesn't seem to work

2017-07-29 Thread bkerin
> Maybe you won't even need macros, because you can get done a lot already with > generics and iterators on object members. I've been poking through the nim docs a lot but haven't run into a discussion of this approach?