Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Mar 03 2017 15:52
    @dom96 banned @Octopoda7
  • Feb 12 2017 23:57
    @dom96 banned @zzz125
  • Dec 23 2016 19:43
    @dom96 banned @Izrab
From IRC (bridge bot)
<Zevv> so you eather need to use it, or explicitly "throw it away", using "discard findmax(5, 6)"
<Zevv> And we all know Mirans books are known to be full of errors
<Zevv> oh, wait, he's here. I didn't say that
<narimiran> :⁠P
doh! should have tried echo...disregard
From IRC (bridge bot)
<Araq> Zevv, ok, they are "dirty" but often easier and that's what counts
Great book Miran, it's been an excellent refresher
From IRC (bridge bot)
<narimiran> bevo009 i think it is a valid complaint. maybe there should be a sentence/paragraph/example warning discarded value
<narimiran> *warning about ...
<livcd> narimiran: will you write "Nim advanced" ?
<narimiran> bevo009 thanks! if you find more confusing stuff like this one, please open an issue in the repo, so i can improve it
<narimiran> livcd: i would like to write it at some point, but currently i don't have enough time for it
From IRC (bridge bot)
<Zevv> Araq: I have some cases in which --expandMacro is not expanding my macros, but I'm not able to figure out what the conditions exactly are - is this a known issue?
From IRC (bridge bot)
<Araq> Zevv, never heard of it before
<Araq> and it's hard to imagine how it can fail
From IRC (bridge bot)
<zedeuss> Is there a way to accomplish this? Using a string variable to generate a field access: https://play.nim-lang.org/
zedeuss: if I understand your intention correctly, then no. The name field of Pref is only filled at runtime, but in order to access a field, the name must be known at compile time. However, you can access object fields in a similar manner from a string. But only if that string is static (i.e. defined at CT). So your pref instance must be defined as a const. Like so: https://play.nim-lang.org/#ix=1Rww
Nim not raising exception when "overflowing" range types is a bug, right?
on js
Alexander Ivanov

got <proc (e: js){.closure.}>
but expected one of:

proc (e: js){.closure.}

doesnt sound right
i tried to make the compiler accept with
tabInfo.monacoEditor.onKeyDown((proc(e: js))proc (e: js) =
if e.browserEvent.defaultPrevented.to(bool) and e.keyCode != monaco.KeyCode.Escape:
the def is onKeyDown*: proc(e: js)
it can be workaround-ed with .toJs on strategic places
From IRC (bridge bot)
<disruptek> this is producing a "strutils is imported and unused" warning in devel, though not in the playground: https://play.nim-lang.org/#ix=1RxI
From IRC (bridge bot)
<clyybber> Araq: How can I make testament output the compile time output when compiling the tests?
From IRC (bridge bot)
<rayman22201> new Nim -> Godbolt question. It turns out, the codegen hash can have _ characters in it. So I can't just split off everything after the last _, as originally suggested.
<rayman22201> Any alternate ideas for demangling nim function names?
<clyybber> Everything after the first _ ?
<dom96> rayman22201, reverse engineer the mangling algorithm?
<rayman22201> @clybber, it's the last _, because _ can be in the function name (it's not the nep1 standard but it's allowed)
<clyybber> rayman22201: Have you tested that it wont get style-insensitivized away?
<rayman22201> @dom96, It's just the md5 hash appened on the end I believe. But it's not "reversible" in that way
<rayman22201> I have tested it. The codegen puts it in how it's written
<dom96> md5 allows underscores?
<clyybber> rayman22201: Doesn't the hash have a consistent length?
<rayman22201> It's actually likely that some other crap is also getting appended on the end
<clyybber> dom96: md5 doesnt know what a underscore is
<rayman22201> or md5 is outputing a hash that happens to get ascii stringified into an _ in this case
<clyybber> rayman22201: What kind of crap?
From IRC (bridge bot)
<rayman22201> snippet of some asm for you
<clyybber> rayman22201: Ah alright
<rayman22201> for a proc called "sqaure_c" in case that wasn't obvious.
<clyybber> Then cut off anything that fits this pseudo regex: _<16chars>_someNumberOrWhatever
<rayman22201> I just need to find out what "_someNumberOrWhatever" is
<rayman22201> good idea though