no, you named a module same way as another symbol, and module takes precedence.
nothing to do with tables.
i think Image is first recognized as module. rename it to lowercase.
there is no way for generic to infer the value of N, so it cant work as a
converter.
> [https://gist.github.com/Yardanico/9a2677bd8d7c5e0e869cbe451dd175cc](https://gist.github.com/Yardanico/9a2677bd8d7c5e0e869cbe451dd175cc)
> gonna use that to scare people on hackernews
proc fac(0): int = 1
Run
thats not a valid nim.
what's the bug?
compiler crashes are not expected behavior. you should report it on github.
var s = new seq[int]
Run
this should work
> What would be the reason for the following output?
you are passing tuples
-d:danger -d:lto|
> but a combination of poor documentation, inelegant or unstable APIs,
> unresponsive developers
hey, im trying
only on windows
thats not correct
for i in 9..4: echo i # 9, 8, 7, 6, 5, 4
Run
you need to add requires "crc32" to nimble file
you can use auto return type for return type inference then use when T is
string/array/whatever to separate code paths for different types.
https://github.com/planety/prologue
openarray is not a concrete type, you can use it only in procedure
declarations. you need to use array or a sequence.
https://nim-lang.github.io/Nim/nimscript.html
yes, you need devel branch
https://github.com/zevv/with
`var refT: ref T refT[] = t `
Run
juan's snippet still resolves import at compiletime. nim is not python.
oh, its another blogpost from person who just read the tutorial and never wrote
more than 100 lines of nim, and never seen another nim codebase, who just needs
an excuse to use rust/go/whatever. its like you dont use vscode or vim with ide
features already for knowing "where the stuff comes
>code from different sources become inconsistent. 99% of nim code i've seen
>uses 2 spaces just fine. other percent is from people who use nim less than a
>week. but with tabs code does become inconsistent.
use -d:danger if you need performance
try starting with the tutorial
[https://nim-lang.org/docs/tut1.html#statements-and-indentation](https://nim-lang.org/docs/tut1.html#statements-and-indentation)
that doesnt work with choosenim
just dont send any messages to irc from these channels? not everything should
be bridged.
you are returning value, not reference. change return type to var Child
thats why you should make it a proper nimble package.
last-gardener/src/pattern.nim(73, 16) Error: type mismatch: got
this one can be fixed by importing random, but then this error pops up.
last-gardener/src/scenes.nim(104, 9) Error: attempting to call undeclared
routine: 'initScene'
doesn't compile. i tried fixing the errors, but each time a new pops up. you
probably pushed old version or missed some file.
invoke items/pairs iterator explicitly
there is no split iterator that returns two values at a time. you're confusing
it with sequence and implicit pairs. you have to keep track of the indexes on
your own here.
try latest stable?
doesn't compile for me.
Error: implementation of 'test.get_descriptions() [declared in test.nim(3,
6)]' expected
Run
whats your nim version?
dependencies get installed automatically when building/installing the package.
[https://github.com/nim-lang/nimble#dependencies](https://github.com/nim-lang/nimble#dependencies)
how is that related to nim/programming?
> I will never use it to represent a student in this example.
what does this even mean?
something like that
proc commonPrefix*(paths: openArray[string], sep = "/"): string =
if len(paths) > 0:
result = paths[0]
for i in 1 .. paths.high:
let path = paths[i]
while not path.startsWith(result) and len(result) > 0:
is this a joke to you?
varargs contruct take type and optionally a converter procedure, so you can
pass differently typed arguments to varargs procedure.
for templates and macros if you omit the type they are assumed as untyped
parameters. careful with , and ; here.
nim implicitly dereferences pointers, there is no difference between these
snippets.
there is no nil, it reports wrong size.
thats how bindings define that proc. and it doesn't matter in that case, its
just an array index.
I have two snippets, in C and Nim which _supposed_ to be exact copies of
eachother.
#include
#include
#include
typedef struct keymap {
int keycode_high;
int keycode_low;
} keymap_t;
keymap_t keymap_new(Display *dpy) {
keymap_t
but uint is... what?
uint64 is not an ordinal
[https://nim-lang.github.io/Nim/manual.html#types-ordinal-types](https://nim-lang.github.io/Nim/manual.html#types-ordinal-types)
[https://www.reddit.com/r/nim/comments/df2t60/nim_in_action_worth_it_with_10](https://www.reddit.com/r/nim/comments/df2t60/nim_in_action_worth_it_with_10)/
another bot
https://nim-lang.github.io/Nim/manual.html#foreign-function-interface-exportc-pragma
> What a waste of space, I spend more time scrolling through the terminal than
> actually fixing bugs.
this is the most nonissue _problem_ i've heard of. almost on par with & being
unreachable key.
you didnt export extraData field.
works fine on my machine. why are you using 4 year old version of nim?
nimble search
* you can see defaults in nim.cfg supplied with the compiler.
* check styleCheck compiler option.
* there is no runtime cost.
* koch tools builds nimble.
what
this is a bot
[https://www.reddit.com/r/nim/comments/dwv3ms/pimp_up_this_sub](https://www.reddit.com/r/nim/comments/dwv3ms/pimp_up_this_sub)/
https://nim-lang.github.io/Nim/iterators.html#fieldPairs.i%2CT
[https://narimiran.github.io/nim-basics](https://narimiran.github.io/nim-basics)/
badabing
[https://github.com/SolitudeSF/adventOfCode](https://github.com/SolitudeSF/adventOfCode)
whats strange is that if you just copy the function from math to current module
it will raise properly.
type Probability = range[0.0..1.0]
proc sum*[T](x: openArray[T]): T {.noSideEffect.} =
## Computes the sum of the elements in ``x``.
##
## If ``x`` is
ah, its not strange at all, math module just explicitly disables all checks
{.push checks: off, line_dir: off, stack_trace: off.}
Run
Rule #0: Read the tutorial
huh, at least now i know that im not pushing broken updates.
i know where pragmas should be, so i have 0 trouble looking for them. this is
another nonissue.
> is a far cry from this in readability terms:
it looks the same
still has some dumbass dependency on bash and git. at least python is gone.
when you're listing multiple parameters under one type like this
proc test(a, b: int)
Run
if you're gonna use semicolon, the a parameter wont be an int. in current nim
thats just useful when you're using the using statement
what is the point of customTask that is not even defined locally, if you can
just add -p:-d:danger?
this doesnt work
why? if you need to apply configuration you should use nim.cfg or config.nims,
not override default actions.
no, one language cant look exactly like the other just because you learned it
first.
i dont get the point of these categorized lists. if i need something, i search
for it using existing search tools, not wander around some _curated_ list.
whats the point? code produced by nim is not supposed to be read, unless for
some edge case debugging.
[https://github.com/alehander92/poly](https://github.com/alehander92/poly)
there is a macro for that
thats a cool opinion, having 0 language experience and extensively using
language that does something opposite. would be nice if people instead of
imagining things and speculating how they could work actually tried to use them.
"string".len
[https://github.com/SolitudeSF/imageman](https://github.com/SolitudeSF/imageman)
its heavily wip but it works. if something doesnt work or functionality is
missing, issue on github would be much appreciated.
you dont have proper unicode in your console
read the tutorial/manual.
[https://nim-lang.org/docs/tut2.html#object-oriented-programming-method-call-syntax](https://nim-lang.org/docs/tut2.html#object-oriented-programming-method-call-syntax)
just compile it yourself and place its binary in PATH. its sources are included
with nim.
[https://nim-lang.github.io/Nim/manual.html#procedures-anonymous-procs](https://nim-lang.github.io/Nim/manual.html#procedures-anonymous-procs)
just omit the procedure name
no harm in bumping it
comments are even better then usual reddit/hn crowd.
git clean -f
this idea gets a yikes from me. this is totally not gonna cause a lot of issues
and unexpected side effects.
no, im not salty because all my packages got sub 3 code quality.
i made library that does maybe a bit more than you need, but it can handle this
case [https://github.com/SolitudeSF/shlex](https://github.com/SolitudeSF/shlex)
this works
import httpclient, xmltree, htmlparser, strtabs
import nimquery
var client = newHttpClient()
var url = "https://www.instagram.com/p/B1oqkXKFlcD;
var htmlsrc = client.getContent(url)
let xml = parseHtml(htmlsrc)
let elements =
use parseHtml from httpparser and xmltree to get tree structure that you can
traverse then yourself or use something like
[https://github.com/GULPF/nimquery](https://github.com/GULPF/nimquery) to find
the element you need.
nim is not object oriented, is doesnt have such concept.
medvednikov is a lowtier scammer and nobody should give him attention or
respect. maybe araqs remark was a bit inappropriate, but freaking out over non
issue isnt helping anybody.
i wrote macros
([https://github.com/SolitudeSF/imageman/commit/c29c13fb570785891f7b5458e2b70e69ae773d80](https://github.com/SolitudeSF/imageman/commit/c29c13fb570785891f7b5458e2b70e69ae773d80))
that generate mutating/nonmutating versions of procedures specifically for
this reason
kakoune. it has some lsp capabilities with 3rd party plugin, but both the
plugin and especially nimlsp are very underdeveloped.
`converter toSeqUint8(s: string): seq[uint8] = cast[seq[uint8]](s) let s:
seq[uint8] = "test" doAssert s == @[116'u8, 101, 115, 116] `
Run
{} is a sugar for array of tuples, so @ already works with it by just making a
sequence.
echo @{"key_1": "value_1", "key_2": "value_2"}
Run
results in
@[("key_1", "value_1"), ("key_2", "value_2")]
Run
i can compile and run demos on latest devel with no modifications other than
correct path to glu module.
why would it? arguments need to be evaluated first
To crosscompile to windows you just need to provide -d:mingw
would be nice if its was a nimble project
Nice.
> Enforced prefix (con.) API isolation.
yikes
1 - 100 of 132 matches
Mail list logo