Re: Nim Compiler Documentation

2020-05-17 Thread lotzz
i have not, i will take a look at that now, thank you

Nim Compiler Documentation

2020-05-16 Thread lotzz
This is just a simple question. I have started looking at the nim compiler source and trying to implement my own backend for nim. Is there not documentation for the nim compiler or is it reserved for developers? I might just not have found where it is though.

Re: Error: unhandled exception: paramCount is not implemented on Nintendo Switch [OSError]

2020-05-01 Thread lotzz
thanks i will do that

Re: Error: unhandled exception: paramCount is not implemented on Nintendo Switch [OSError]

2020-04-29 Thread lotzz
If there is no quick fix, i guess i can patch the file. but i just thought id show this because it is weird

Error: unhandled exception: paramCount is not implemented on Nintendo Switch [OSError]

2020-04-29 Thread lotzz
I got this error msg from this code #The file is get_saves.nims import parseopt import "check_installed.nims" echo check_installed.exists var ops = initOptParser() while true: ops.next case ops.kind of cmdEnd: break of cmdLongOption, cm

examples or documentation of Source Code filters

2020-03-21 Thread lotzz
Hi, sorry I am looking into the source code filters for nim and it is actually kind of hard to figure out what a good use case for them is, or if they have any uses besides just generating xml. I was just wondering if anyone had any examples of how they have used them in their projects or anywhe

Re: unable to deference pointer and assign? Nim 1.0.6

2020-02-17 Thread lotzz
ah thank you so much

unable to deference pointer and assign? Nim 1.0.6

2020-02-17 Thread lotzz
So I'm just messing around and from what I understand this code should be fine, but for some reason I'm getting an error. I am wondering if there is something I don't understand about pointers in Nim and how to use them proc newLead[T](oldData:T):Lead = #copy the data if the

Re: Is allowing non-matching types for assignment overloading in the development timeline?

2019-04-18 Thread lotzz
Wow thanks, I didn't know about this use of converters. I can simplify a lot it code with this!

Re: Auto import file with config.nims

2019-04-16 Thread lotzz
Oh I figured it out the --import argument in the computer

Re: Auto import file with config.nims

2019-04-16 Thread lotzz
Sorry, I want to do something like. Include a module automatically to my project without having to call import in every file. Like the standard library. I'm wondering if I can do that using nimscript or something else

Auto import file with config.nims

2019-04-16 Thread lotzz
Might be a noobish question but I've googled for a while and I can't find anything on being able to automatically import files in a project, like the system module

Re: FOSDEM "Metaprogramming in Nim" talk now online

2019-02-06 Thread lotzz
Nice, for the amount of time you had it was a good taste of what nim can do. Not really how to do it but it should get people interested in that

Re: Deleting a certain value from a sequence

2019-01-23 Thread lotzz
I like @Araq s suggestion as well lol

Re: ability to undefine a symbol?

2019-01-17 Thread lotzz
Fair enough thanks for the time

ability to undefine a symbol?

2019-01-16 Thread lotzz
Is there anyway to undefine a symbol in nim using macros? like in C you can do #define SYMBOL_NAME #undefine SYMBOL_NAME Run

Re: Associating data to types

2019-01-13 Thread lotzz
you can also hold data on types by using static though then it needs to be known at compileTime type typeWithData[data:static[auto]] = distinct object var a:typeWithData[10] echo a.data #outputs 10 Run

Re: recommendation for simple graphics lib?

2019-01-10 Thread lotzz
thanks for the suggestions, as for my question not being smart. I didn't say because I don't know exactly what I plan to do. I am researching options at the moment.

recommendation for simple graphics lib?

2019-01-08 Thread lotzz
the title says it all, I am wondering if anyone has suggestions for very simple 2d graphics library. I have looked at the cairo github for nim but it hasn't been updated in 2 years so I am not sure if it still functions with the current version of nim

Re: Should we get rid of style insensitivity?

2018-11-20 Thread lotzz
I think a vote is good, will be voting no for the change though

Re: Compiler plugins?

2018-09-27 Thread lotzz
What can they do??? Is there documentation?

Compiler plugins?

2018-09-27 Thread lotzz
Digging up a dead thread, is there anybody who knows exactly what you need to do to make a compiler plugin?

Re: How to check an auto type parameter in a proce

2018-09-27 Thread lotzz
yeah sorry, I don't use it much "typeinfo" got it

Re: Nim source equivalent to C #define

2018-09-26 Thread lotzz
i just want to say, i love how many good options nim has for such a simple thing. Nim -- a buffet for the programmers taste

Re: Nim source equivalent to C #define

2018-09-26 Thread lotzz
const Thing = 0 when declared(Thing): const otherThing = 0 when declared(otherThing): echo "we are here" Run this works

a small change to macros.getCustomPragmaVal

2018-09-26 Thread lotzz
real quick here is the code for the change macro getCustomPragmaVal*(n: typed, cp: typed{nkSym}): untyped = let pragmaNode = customPragmaNode(n) result = newTree(nnkPar) for p in pragmaNode: if p.kind in nnkPragmaCallKinds and p.len > 0 and p[0].kind == nnkSym

Re: How to check an auto type parameter in a proce

2018-09-25 Thread lotzz
the module typetraits might be able to help you

Re: Is there any untyped list data type in Nim ?, like in python.

2018-09-25 Thread lotzz
I might be able to help > 1.Node is a ref object. Yes, it is. Acting like a pointer (guessing at the inner workings of this) with the statement case kind: NodeKind # the ``kind`` field is the discriminator of nkInt: intVal: int of nkFloat: floatVal: float

Re: How to check an auto type parameter in a proce

2018-09-25 Thread lotzz
Do you need to know the type at runtime?

Re: a funny compiler crash

2018-09-24 Thread lotzz
looks like there was some other problem. you are right that example now works I assume i was using a 32 bit version of gcc or nim or i wasnt as up to date as i thought I will close the issue

Re: a funny compiler crash

2018-09-24 Thread lotzz
ah, yeah fixed the indentation and case mistakes, same problem though made an issue ticket on github [https://github.com/nim-lang/Nim/issues/9054](https://github.com/nim-lang/Nim/issues/9054)

Re: a funny compiler crash

2018-09-23 Thread lotzz
Might be because I'm using 0.18.0, I will see

Re: a funny compiler crash

2018-09-23 Thread lotzz
Os and compiler?

Re: shorthand if statement

2018-09-23 Thread lotzz
Sometimes, I just like astetics ok guys

Re: shorthand if statement

2018-09-23 Thread lotzz
You realize this evaluates both statements regardless of the condition Run Evaluated yes with a bit different syntax? Run Yes

shorthand if statement

2018-09-23 Thread lotzz
**_IF_** you have been looking for a shorthand if statement here is some code type pair*[T] = (T,T) template `|`*[A](a:A,b:A):pair[A] = (a,b) template `?`*[T](cond:bool,res:pair[T]):untyped = if cond: res[0] else: res[1]

Re: shorthand if statement

2018-09-23 Thread lotzz
oh how to use it var a = 0==1 ? 1|2 # == 2 var b = 0==0? 1|2 # == 1 #must give the same types for the result Run

Re: shorthand if statement

2018-09-23 Thread lotzz
oh how to use it var a = 0==1 ? 1|2 # == 2 var b = 0==0? 1|2 # == 1 #must give the same types for the result Run

Re: a funny compiler crash

2018-09-23 Thread lotzz
will do

Re: a funny compiler crash

2018-09-23 Thread lotzz
I'm not sure if its just my computer, but that crashes something. my program won't output anything now

Exploring namespaces support in Nim

2018-09-23 Thread lotzz
going to dig up an old thread, I would still love to see from module import type foo Run

Re: a funny compiler crash

2018-09-23 Thread lotzz
came up with a fix, so you cannot supply different types type same[T] = T Gen[A:auto,val:static[same[A]]] = same[A] Run

a funny compiler crash

2018-09-23 Thread lotzz
So today i was messing around with Generic types and I found something that I think would be considered "Undefined behavior". I thought I would just share it here in case anyone else gets the same idea. type Gen[val:static[auto]] = auto true_t = Gen[true] var a:

Re: Returning from Concepts

2018-09-21 Thread lotzz
alright, thank you very much. Just another question do you know if its planned for V1 or working in devl?

Returning from Concepts

2018-09-21 Thread lotzz
I have just started playing around with concepts, but I'm very confused about what this return statement is used for with the generics converters I have tried to do the exact same example and nothing seems to work. though I don't understand what should be happening anyway. Any help would be grea

Re: --stdout question

2018-08-09 Thread lotzz
that seems useless

--stdout question

2018-08-02 Thread lotzz
Just a quick question, the compiler flag --stdout says it outputs to stdout, am I assuming that it gives the resulting binary to stdout incorrectly?

Re: quick question about macros

2018-05-16 Thread lotzz
thank you very much

Re: quick question about macros

2018-05-16 Thread lotzz
another way to say this I guess is, will a bunch of macro definitions bloat my code?

quick question about macros

2018-05-16 Thread lotzz
Do macro declarations end up in the resulting C files?

Nim as a run time interpreter?

2018-03-27 Thread lotzz
I am looking for a way to evaluate Nim at run time, is there anything to recommend?

Re: Why is my destructor not called?

2018-03-15 Thread lotzz
> I am on Windows 10, Nim Compiler Version 0.18.0 [Windows: i386], MinGW GCC. I don't know if that is just for windows 10, I am on ubuntu with 0.18.0 and I am getting the same thing though my code is a little different {.experimental.} type thing = object x:int p:poi

Re: Delaying macro expansion

2018-03-02 Thread lotzz
well this isn't exactly delaying macro expansion I found a work around that works for what I want I changed getRNG into a static proc static: proc getRNGS():uint32 = mz = (36969u32 * mz and high(uint32) + (mz shr 32)) #echo tobin(mz.int,64) mw = (18000

Delaying macro expansion

2018-03-02 Thread lotzz
So I am making just a small compile time RNG and having a few problems macro getRNGF*():float = let fh = high(uint32) let fr = getRNG() return fr.float / fh.float the getRNG proc is another macro that affects some static variables declared earlier, but the pro

Re: Community name?

2018-03-02 Thread lotzz
nimeks, like planet namek in dragonball z

Re: static macro

2018-03-02 Thread lotzz
you are right, thank you

Re: static macro

2018-03-01 Thread lotzz
alright thank you, that narrows my search

static macro

2018-03-01 Thread lotzz
Just a quick question, I have been looking for where the static macro is defined so I can look at how it is implemented does anyone have an idea of where that would be?

Re: two questions about static

2018-01-14 Thread lotzz
yeah I have noticed that too, might be a bug... I wouldn't know how to go about stating that though

Re: two questions about static

2018-01-10 Thread lotzz
Awesome Thank you, that worked great

Re: Wow. It all 'just works'

2018-01-10 Thread lotzz
I have started using nim just recently as well, and I can agree with you this language is great! My brother is the one who let me know about this language because he has been watching me do experiments with compiler abuse in C++ (which if I wanted to do anything fun I had to abuse the compiler),

Re: two questions about static

2018-01-10 Thread lotzz
Here I have made an example of what is happening #module A static: var test=0 proc test_proc(): void {.discardable,compileTime.} = var a = test echo a #module B import A static: test_proc() this will

Re: two questions about static

2018-01-10 Thread lotzz
thanks, I think i learned I have a completely different problem then what I thought was going on, I will try to figure it out before I bother more people about it, but what is happening is that a proc I have made is using static variables defined in one module, but when I export that proc and us

two questions about static

2018-01-10 Thread lotzz
So just to start, I am very new to nim I started reading about it and programming in it 4 days ago. I understand that using static like this static: var some_variable = 10 evaluates the statement at compile time and uses the Nim VM to do that my questions are, is there