Re: Get first element in Table

2019-11-07 Thread miran
> if you want to iterate and break after the first then you can use any of the > table types It is just a current implementation detail / coincidence, that your first example returns `1` as the first key. Don't rely on that, please. * * * Btw, if you (plural) want sorted tables, there is a

Re: [Talk] What FP Can Learn From Static Introspection. (features Nim heavily)

2019-11-07 Thread mratsim
Is there a competition on longest repo name I am not aware of? ;)

booting nim on Linux

2019-11-07 Thread Nuumi
When loading the terminal command: curl https://nim-lang.org/choosenim/init.sh -sSf | sh Throws error: exception: execution failed with exit code 1 ... Team: SH build.sh ... Output: # OS: linux ... # Processor: amd64 ... CCC-W-O3-TNF-strict

Re: Getting memory address of object into string

2019-11-07 Thread drkameleon
I still have issues... I have some ref objects and trying to get the hex address of the objects using repr(addr(x)) but when trying to echo the value the output is ... whitespace(!). Is it possible that it has sth to do with my configuration and/or compilation options? I cannot explain it

Re: Disabling unused import warning locally

2019-11-07 Thread cdome
Fix went in. {. warning[UnusedImport]:off .}` works now, but it needs to be active at the end of module as this is where the check is happening

Re: compiling to typescript

2019-11-07 Thread kobi
I only meant that it is probably a more direct translation, and their full time employees are actively developing and working on optimizing etc. so Nim can benefit from that. I imagine in the future, instead of keeping up with js new features and possibly deprecations, no effort is being lost

Re: A taxonomy of Nim packages

2019-11-07 Thread Stefan_Salewski
There was another similar attempt recently, see [https://forum.nim-lang.org/t/5190#32541](https://forum.nim-lang.org/t/5190#32541) Thank you for your effort, but I can not imagine that such an incomplete list can be very helpful. For example Araq listed the GUI packages recently, I think that

Re: Get first element in Table

2019-11-07 Thread cblake
(Sometimes this path handle I am advocating is referred to as a "cursor" in analogy with text-editing. I don't usually see it motivated by coding economy/simplicity for optionally augmented trees, as I am motivating it here. Anyway, these comments/analyses are probably better made as issues on

Re: [Talk] What FP Can Learn From Static Introspection. (features Nim heavily)

2019-11-07 Thread deech
https://github.com/deech/LambdaWorldCadiz2019-WhatFPCanLearnFromStaticIntrospection

Re: Get first element in Table

2019-11-07 Thread AMoura
I don't use the Table object properly. I'm going to change my data structure. Thank you.

Re: Get first element in Table

2019-11-07 Thread cblake
Minor correction to @mratsim \- if you want to iterate and break after the first then you can use _any_ of the table types, not only `OrderedTable`. E.g. import tables var a = {1: "one", 2: "two"}.toTable for key, val in a: echo key break Run Of

Re: Get first element in Table

2019-11-07 Thread cblake
Of course. I suppose I should have been explicit to mention things are "system/data-structure ordered" not "key ordered". Any iteration has "an" order, though. That weird order just may or may not be what is desired or it might be fine. In terms of your `sorta`/B-Tree I would say that (like

Get first element in Table

2019-11-07 Thread AMoura
Hello everyone, How to get the first element in a Table ? My example : import tables var a = {1: "one", 2: "two"}.toTable echo a.keys[0] Run The result, for me, should display **1**. Thanks.

Re: Get first element in Table

2019-11-07 Thread drkameleon
Given that a table is not an ordered collection, how is it possible to get any first element? As an alternative you could implement it as an array of tuples for example: var a = @[ (1,"one"), (2,"two") ] Run and then you could easily retrieve a[0].

Re: Getting memory address of object into string

2019-11-07 Thread mikra
I sometimes use $cast[int](addr(x)). If you like it hex just transform the integer into a hex string...

Re: Getting memory address of object into string

2019-11-07 Thread mratsim
Note that it's fine to use them for logging or debugging but otherwise the GC can and will move those ref addresses in memory for cycle detection purposes if you have a cyclic type (unless you compile with pure refcounting with no cycle detection or you tag your cyclic type acyclic).

A taxonomy of Nim packages

2019-11-07 Thread spip
When you are searching for packages for your projects, this [categorized list](https://github.com/pmetras/packages/wiki) can help you to start. They could be added to [Awesome Nim](https://github.com/VPashkov/awesome-nim) too.

Re: Cannot Install Nim

2019-11-07 Thread joe_04_04
Thanks you very much for the link, however, the solution proposed is to use the command that installs the headers, but attempting to install that throws the follow scary error: "Installing this package may damage your system, and the installation may fail. To stop the program and the

Re: Screenshot / Screencapture

2019-11-07 Thread JohnS
I submitted a PR: [https://github.com/Senketsu/nsu/pull/3](https://github.com/Senketsu/nsu/pull/3) * Updates nsu to work with Nim 1.0 * Migrates from oldwinapi to winim * Removes the dependency on the broken png library and libpng.dll (replacing it with Flippy, thanks @treeform !) *

Re: tye and container whoes

2019-11-07 Thread ingo
In the end I kept it simple: [https://gist.github.com/ingoogni/ed87bc92c5d2a2da5038dd368a238ac5](https://gist.github.com/ingoogni/ed87bc92c5d2a2da5038dd368a238ac5) Thanks.

Re: booting nim on Linux

2019-11-07 Thread Araq
Install the "build-essentials" package or similar so that you have a working clang/gcc installation.