Re: Equivalent of dir() in python

2018-09-02 Thread Libman
Here's a very **very** stupid nimdir.sh script that I find useful: #!/bin/sh libPath=~/.choosenim/toolchains/nim-0.18.0/lib # libPath=$(choosenim --noColor show | grep ' Path: ' | awk '{print $2}')/lib nimFile=$(find $libPath -iname $1.nim | sed 1q) [ -f "$n

Re: Equivalent of dir() in python

2018-09-01 Thread wizzardx
I've learned a bit more since then (now also on last chapter of Nim in Action. Templates and Macros are also starting to make more sense). Also a bit of a better idea of the fine line between where metaprogramming vs actual compiler internals lie, where you can and can't cross the two. Probably

Re: Equivalent of dir() in python

2018-08-30 Thread wizzardx
Is it possible to use metaprogramming to iterate through all of the available procs, and then return them as a list or tuple at runtime? I think this is how both "locals()" and "repr()" already work in Nim.

Re: Equivalent of dir() in python

2018-08-26 Thread mratsim
In VSCode with the Nim language support when you write a dot you have autocompletion/nimsuggest that gives you relevant procs.

Re: Equivalent of dir() in python

2018-08-25 Thread Allosteric
Thank you for your reply. They seem very handy as a document but that is not what I want. I'm supposing a situation, for example, where I import several libraries (with some poorly documented) and would like to know whether a given proc is defined for a given object. (Of course, I can try `proc

Re: Equivalent of dir() in python

2018-08-25 Thread Allosteric
Thank your for your reply. While I'd love to do so, my text editor is currently kind of broken and cannot do so. Moreover, I would like to know how the IDE manages the function and also, they would be helpful in `nim secret`.

Re: Equivalent of dir() in python

2018-08-25 Thread Stefan_Salewski
When you are looking for all the string "methods" you may go to [https://nim-lang.org/docs/system.html](https://nim-lang.org/docs/system.html) and select "Group by Type". Then procs are listed grouped by types.

Re: Equivalent of dir() in python

2018-08-25 Thread mratsim
Nim is not a dynamic language, your IDE should do that instead.

Equivalent of dir() in python

2018-08-25 Thread Allosteric
I'm looking for the Nim equivalent for dir() in python, which returns a list of properties and bound methods. For example, `dir(str)` would return a list like `['__add__', ...,'split',...]` which is very handy to find ways to manipulate the object. The Nim equivalent might be a combination of "