ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
swav has quit [Ping timeout: 256 seconds]
swav has joined #crystal-lang
<FromGitter> <redcodefinal> Hi guys, I noticed a potential issue or maybe I'm just being stupid. From my understanding when you roll a signed int over it should go from being (binary) 31 1's to negative 31 1's. I've noticed that the overflow in the Int32 for crystal actually goes to (binary) -10000000000000000000000000000000 or -2147483648. Am I making a mistake here? https://play.crystal-lang.org/#/r/1d5t
<FromGitter> <jwoertink> I love people like this ^
<FromGitter> <jwoertink> My head explodes just thinking about stuff like that
tomchapin has joined #crystal-lang
<FromGitter> <jwoertink> What does `Invalid memory access (signal 11)` mean?
Philpax has joined #crystal-lang
tomchapin has quit [Ping timeout: 265 seconds]
tomchapin has joined #crystal-lang
Philpax has quit [Ping timeout: 250 seconds]
<FromGitter> <cjgajard> I don't know exactly, but I've reached signal 11 accessing uninitialized vars `x = uninitialized String; puts x` ⏎ and with infinite recursion `def foo; foo; end; foo`
<FromGitter> <jwoertink> I got it from passing a Hash in to a method. I ended up making the hash a Bool, and it went away
Philpax has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Philpax has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
<FromGitter> <cjgajard> @redcodefinal Crystal uses (~number + 1) for negative integers. That is hard to read (example: `15_i8` is "00001111" in memory, while `-15_i8` is "11110001" ) because of that, I suppose, `to_s` checks if the number is negative, and displays "-number_as_positive" when it is negative
kulelu88 has quit [Quit: Leaving]
vikaton has quit [Quit: Connection closed for inactivity]
ome has joined #crystal-lang
onethirtyfive has joined #crystal-lang
lacour has quit [Quit: Leaving]
onethirtyfive has quit [Remote host closed the connection]
Fichtenstein has joined #crystal-lang
mark_66 has joined #crystal-lang
Philpax has joined #crystal-lang
<FromGitter> <International> when using macros, is there any way of seeing the code that gets sent to the compiler? something equivalent to seeing how C code looks after the preprocessor preprocessed it
<BlaXpirit> International, use {% debug() %} inside a macro to output its result
<BlaXpirit> redcodefinal, um basically everything is correct
<BlaXpirit> >> {Int32::MIN, Int32::MIN.to_s(2), Int32::MAX, Int32::MAX.to_s(2)}
bjz has joined #crystal-lang
<BlaXpirit> {-2147483648, "-10000000000000000000000000000000", 2147483647, "1111111111111111111111111111111"}
<BlaXpirit> there is one more possible negative value, because the 0 eats into one possible slot for positive values
onethirtyfive has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
matp_ is now known as matp
soveran has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
optikfluffel has joined #crystal-lang
Fichtenstein has quit [Ping timeout: 260 seconds]
Fichtenstein has joined #crystal-lang
<FromGitter> <International> does anyone have experience with `mocks.cr`?
<FromGitter> <sdogruyol> @International i do
<FromGitter> <International> can you have a look at https://github.com/waterlink/mocks.cr/issues/25 ?
<FromGitter> <International> i've just opened it now
<FromGitter> <International> I cannot get `Process.run` mock to be called
<FromGitter> <sdogruyol> ah sorry i mistook it as webmock.cr :(
<FromGitter> <sdogruyol> never used mocks.cr
<FromGitter> <International> no problem :)
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 260 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <International> is it possible to reopen STDOUT to a string?
Raimondii has joined #crystal-lang
<BlaXpirit> International, https://github.com/mosop/stdio
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
gloscombe has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
optikfluffel has quit [Quit: Textual IRC Client: www.textualapp.com]
soveran has quit [Remote host closed the connection]
shawn42 has joined #crystal-lang
sustained has joined #crystal-lang
pduncan has joined #crystal-lang
Davy_CC has quit [Ping timeout: 256 seconds]
Davy_CC has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
c_ has joined #crystal-lang
c_ is now known as Guest10017
Guest10017 has quit [Client Quit]
<crystal-gh> [crystal] ysbaddaden pushed 8 new commits to master: https://git.io/vXGe2
<crystal-gh> crystal/master d060f9c Julien Portalier: AArch64: ABI
<crystal-gh> crystal/master 4058154 Julien Portalier: AArch64: std fixes...
<crystal-gh> crystal/master 572df72 Julien Portalier: AArch64: fiber context switch
Philpax has quit [Ping timeout: 260 seconds]
Davy_CC has quit [Ping timeout: 265 seconds]
Davy_CC has joined #crystal-lang
<travis-ci> crystal-lang/crystal#e5d2bc6 (master - Merge pull request #3491 from ysbaddaden/aarch64-support): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/172627238
mark_66 has quit [Quit: Leaving.]
Davy_CC has quit [Ping timeout: 256 seconds]
Davy_CC has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
<FromGitter> <iDev0urer> Can libs be split into multiple files the same way you would a class or module?
<FromGitter> <International> thank you @BlaXpirit
<FromGitter> <International> has any encountered this issue: `Program received and didn't handle signal TRAP (5)`? I get it when running `crystal spec`
<FromGitter> <International> nvm, i forgot a debugger statement somewhere :)
<FromGitter> <johnjansen> anyone got a good way to timeout a block of code after `x` seconds
<FromGitter> <johnjansen> my brain is frozen
<BlaXpirit> iDev0urer, yes
<BlaXpirit> johnjansen, there really isn't a generic way to do that
<FromGitter> <johnjansen> i need to come up with a good plan, for now just to timeout a `Process` but this will come up over and over
<Papierkorb> johnjansen, what's the block doing? Waiting on IO? Calculating stuff?
<FromGitter> <johnjansen> in this case unzipping a very large file … i need to (for the time being) shell out to do the work, but occasionally something is hanging in the process (i dont know what (YET)) … anyway, this is a recurring theme so i want to think through the whole concept of timeouts, getting a starting point will help engage the brain
<FromGitter> <johnjansen> ;-)
<BlaXpirit> johnjansen, processes is the only thing that can be timed out reliably. should be very easy
<Papierkorb> johnjansen, you can't kill a fiber just like you can't reliably kill a thread (in other programming languages)
<Papierkorb> johnjansen, you could check for a "cancel" boolean to be set every once in a while in your zip tool
<BlaXpirit> johnjansen, here's my idea. `p = Process.new; spawn { sleep 123; p.kill } ; p.wait`
<BlaXpirit> might work but probably will need to be improved
<FromGitter> <cjgajard> @johnjansen , check if this works for you https://github.com/hugoabonizio/timeout.cr
<FromGitter> <johnjansen> a shard, now thats thinking ;-)
<BlaXpirit> mmmmm select
<BlaXpirit> that's gotta be good
<BlaXpirit> so you literally just spawn { ch.send Process.run(...) } and use timeout
<FromGitter> <johnjansen> that leads me to wonder why i havent spotted `select` before and where its documented
<BlaXpirit> johnjansen, well it's new. like 2 months
<BlaXpirit> might not even be documented :D
<Papierkorb> There are samples for it in the source
<Papierkorb> Got some way to go though, you can't wait for IO.read/write with it for instance
<FromGitter> <johnjansen> well that would do it, but where is it in the source. there are some words you just cant search for easily ;-)
<FromGitter> <cjgajard> @johnjansen Papierkorb was talking out the `samples/` folder... check https://github.com/crystal-lang/crystal/blob/master/samples/channel_select.cr
<FromGitter> <johnjansen> naively the process seems a bit like this https://play.crystal-lang.org/#/r/1d79
<FromGitter> <redcodefinal> Is there a way to do an enumerable step? I need to start at 0 and increment by 0.1 until it's 1
ruby_ has joined #crystal-lang
mhib has joined #crystal-lang
<FromGitter> <International> is the bountysource integration not working? i tried now, and a few times in the past to contribute, but i keep getting errors
<FromGitter> <johnjansen> `(0..10).map{ |i| i / 10.0 }` … `.step` might be around somewhere too
<FromGitter> <redcodefinal> @johnjansen yeah i looked up step and didn't see it, i'm coming from Ruby so I hope things like step exist. XD
<FromGitter> <johnjansen> looks like step wants an int ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=581a2db131c5cbef43a9e2db]
<FromGitter> <redcodefinal> aww too bad
<FromGitter> <redcodefinal> i just ended up cheating
<FromGitter> <redcodefinal> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=581a2de6e462097a30fd8179]
<FromGitter> <redcodefinal> I did the thing, now how do I shard it up
kulelu88 has joined #crystal-lang
<FromGitter> <redcodefinal> Oh also, is there a way to make a private block instead of individually making every method I need private private
<BlaXpirit> redcodefinal, no such way
<BlaXpirit> well actually you could make a macro to transform all methods inside it, but..... don't
<FromGitter> <redcodefinal> @FromIRC lame ill get to typing
<FromGitter> <redcodefinal> @BlaXpirit lame I'll get to typing
mhib has quit [Quit: Leaving]
onethirtyfive has quit [Remote host closed the connection]
<RX14> @redcodefinal it's one extra word on your method definition... It's really not that big of a deal.
<FromGitter> <redcodefinal> @RX14 yeah it's just im spoiled by ruby's ```private:``` blocks
<RX14> Plus code is read many more times than it is written, and having a large "private block" where the beginning and ends of it may be off your screen is certainly not readable
<FromGitter> <redcodefinal> @RX14 depends, I usually group my methods by visibility. So if you see a private block everything after it is going to be private. Protected is very rarely used in Ruby, so usually everything is either public or private
<RX14> yes
<RX14> but how can you tell if your method is private if the start of the bkock is off the screen
<RX14> the same applies for class << self
<FromGitter> <redcodefinal> @RX14 Don't write code that goes of the screen <;P
<RX14> yeah right
<RX14> now it's in 400 files
<RX14> is that any better?
<FromGitter> <redcodefinal> @RX14 I actually really like the ```class << self``` paradigm but thats just me.
<Papierkorb> redcodefinal, as does almost every ruby developer
<FromGitter> <redcodefinal> @RX14 if you have 400 files worth of code in one file then yes lol
<RX14> well you can't fit much code into one screen...
<RX14> I dislike `class << self` because it's another place that you have to look to find out about the method
<FromGitter> <redcodefinal> @RX14 I just try to compartmentalize code
<RX14> where in crystal all the information is contained in the method declaration
<RX14> there's no ambient context
<FromGitter> <redcodefinal> @RX14 also ```class<<self ``` comes in handy when you are only defining class level methods/variables
<Papierkorb> Crystal also allows you to reopen a class later and add or even override methods. if you're in for readability, that's the worse offender than a private block like ruby or C++ allows it.
<RX14> @redcodefinal you can `extend self` for that
<Papierkorb> redcodefinal, and as you're indenting the def further, it's also visible that "something's up"
<RX14> reopening classes is pretty rarely used though
<FromGitter> <redcodefinal> I think like most of the "black magic" in ruby it has it's place
<Papierkorb> different people like different things. No "standard code formatter" will ever change that.
<FromGitter> <redcodefinal> I really like using it when I am only defining class level stuff inside a class to ensure that it's clear that the class is simply class level methods
<FromGitter> <redcodefinal> Plus Ruby gives me the tools to not repeat myself
<FromGitter> <redcodefinal> might as well use them
gloscombe has quit [Remote host closed the connection]
<FromGitter> <raydf> Hi everyone, does anybody knows about a template engine in crystal parsed at runtime? without macros?
<RX14> @redcodefinal i think that repetition is a useful tool which should be used correctly
<RX14> @raydf crustache or temel seem to be what you'd want
<FromGitter> <raydf> @RX14 , thanks, crustache looks like a nice one
<FromGitter> <redcodefinal> How do I get a shard on CrystalShards.xyz?
<RX14> upload it to github
<FromGitter> <redcodefinal> @RX14 and crystalshards.xyz will just know?
<RX14> yeag
<RX14> it uses the github api
<FromGitter> <redcodefinal> fancy and good to know
pawnbox_ has quit [Remote host closed the connection]
<FromGitter> <redcodefinal> So I got a weird error.
<FromGitter> <redcodefinal> ```code paste, see link``` ⏎ What do? [https://gitter.im/crystal-lang/crystal?at=581a42b9eed0c3125f2af6df]
<Papierkorb> redcodefinal, use Float32 or Float64
<FromGitter> <redcodefinal> Oh cause it's hiding the real type gotcha
<Papierkorb> Yeah Float is a superclass of those two
<FromGitter> <johnjansen> it also implied auto scaling up and down :-)
<Papierkorb> Shameless self promotion: I just published the BitTorrent client library I'm currently working on at https://github.com/Papierkorb/torrent - Oh and it's very WIP, expect the API to be unstable.
<FromGitter> <redcodefinal> @Papierkorb Nice. I'm working on a Perlin Noise library myself
<FromGitter> <sdogruyol> @redcodefinal your avatar is cool, i liked it
<FromGitter> <redcodefinal> @sdogruyol thanks man I made it myself with some pixels
<FromGitter> <sdogruyol> yeah i like pixel art stuff
<FromGitter> <sdogruyol> nice job
<FromGitter> <johnjansen> very nice @Papierkorb add it to travis and stick a badge on it ;-) then we know if its ready by its status
<Papierkorb> johnjansen, I switched to Spec2 mid-way, so before I enable travis I have to rewrite the Spec "1" tests. They do run fine, but if they fail things get awkward..
<FromGitter> <johnjansen> :-)
bjz has joined #crystal-lang
<maxpowa> Am I missing something or does TCPSocket not have a way to bind to a specific (local) address?
<maxpowa> It looks like UDPSocket has implemented bind(host, port) but TCPSocket doesn't appear to have an equivalent.
<BlaXpirit> maxpowa, maybe u need TCPServer? just guessing from what i vaguely remember
<maxpowa> TCPServer can be used as a client?
<BlaXpirit> maxpowa, ummm no
<maxpowa> I'm connecting to a remote server, but want to bind to a specific IP on the local device.
<BlaXpirit> and TCPSocket can't be used as a server
<FromGitter> <zatherz> ported libui.cr to latest crystal :D http://i.imgur.com/lwP78sM.png
<BlaXpirit> and "bind" is used for servers
<maxpowa> Yes, I know
<FromGitter> <zatherz> well
<FromGitter> <zatherz> not really "ported", more like "fixed"
<FromGitter> <zatherz> it was just using the old casts, `var as Type`
<FromGitter> <zatherz> `crystal tool format` fixed most of those, then I just hand-fixed the rest
<maxpowa> It's not only used for servers
<maxpowa> it's also used for clients that are concerned about what ip they're connecting to a remote ip with.
<maxpowa> Like I said, UDPSocket already has it implemented, it just doesn't appear to be in TCPSocket
<Papierkorb> BlaXpirit, you can bind an outgoing socket onto a interface to insure it *will* use that interface for all communication and not use the systems routing table to decide which interface to use
<maxpowa> ^
sustained has quit [Read error: Connection reset by peer]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <redcodefinal> Ok so another weird issue. ⏎ ```crystal
<FromGitter> <redcodefinal> lol
<FromGitter> <redcodefinal> stupid enter key
<FromGitter> <redcodefinal> but essentially if I run this ⏎ ```get_perlin_noise(1)``` ⏎ it somehow makes it to the ```when 2``` clause instead of the ```when 1``` clause
<FromGitter> <redcodefinal> also my puts at the top isnt showing up and I don't know why
<FromGitter> <redcodefinal> error ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=581a4f1ce462097a30fe687a]
<FromGitter> <redcodefinal> If I run ```get_perlin_noise(1, 1)``` it run the ```when 3``` clause instead of ```when 2```
<FromGitter> <zatherz> is there a shorter way to do the equivalent of `File.join(__DIR__, "whatever")`?
<FromGitter> <redcodefinal> @zatherz ```__DIR__ + '/' + "whatever"
<BlaXpirit> zatherz, how can it get any shorter than that?
<FromGitter> <cjgajard> @redcodefinal is part of the type inference
<FromGitter> <redcodefinal> @cjgajard what do you mean?
<FromGitter> <zatherz> @redcodefinal Crystal will eventually support Windows, and then that'll be wrong
<FromGitter> <redcodefinal> @zatherz one day ;>
<FromGitter> <cjgajard> when you call it just with (1) args type is Tuple(Int) use args[0]?
<FromGitter> <zatherz> BlaXpirit: Seems like a pretty common thing one would do, so I asked just in case there's some sort of builtin macro
<FromGitter> <zatherz> ```record Test, ⏎ a : String ⏎ b : Int32``` [https://gitter.im/crystal-lang/crystal?at=581a506deed0c3125f2b4632]
<FromGitter> <redcodefinal> @cjgajard I dont understand https://play.crystal-lang.org/#/r/1d7t
<BlaXpirit> redcodefinal, what's there not to understand?
<FromGitter> <redcodefinal> @cjgajard took in a splat of ints, and it properly routed to the right when
<FromGitter> <redcodefinal> @BlaXpirit Why would the execution jump to the ```when 2``` clause when args.size would be equal to 1
<BlaXpirit> redcodefinal, but it seems like it doesn't??
<FromGitter> <cjgajard> def foo(*args); end; foo(1) #=> args is infered to be Tuple(Int32) ⏎ def foo(*args); end; foo(1, 2) #=> args is infered to be Tuple(Int32, Int32) ⏎ def foo(*args); end; foo(1); foo(1, 2) #=> args is infered to be Tuple(Int32) | Tuple(Int32, Int32)
<FromGitter> <zatherz> escape your asterisks
<FromGitter> <zatherz> with \\
<FromGitter> <zatherz> alternatively, use \`\`\`
<FromGitter> <redcodefinal> @BlaXpirit It doesn't. Look at the ```get_perlin_noise``` code. It cases ```args.size``` which if a ````Tuple(Int32)``` is ```args``` the ```args.size``` is 1. Am I wrong so far?
<FromGitter> <redcodefinal> @BlaXpirit If that is true, then the proper ```when``` clause should be ```when 1``` not ```when 2```
hako_ has joined #crystal-lang
<FromGitter> <redcodefinal> @BlaXpirit Alternatively would making overloads of the ```get_perlin_noise``` method fix this issue?
bjz has joined #crystal-lang
<BlaXpirit> redcodefinal, it sure would
<FromGitter> <zatherz> @redcodefinal `args` is `Tuple(Int) | Tuple(Int, Int) | Tuple(Int, Int, Int)`
<FromGitter> <zatherz> a tuple is compiletime, so it's bounds are checked at compiletime, not runtime
<FromGitter> <redcodefinal> @zatherz so are you saying that Crystal will prebake the answer to args.size?
<FromGitter> <zatherz> no, it doesn't know what `size` is
<FromGitter> <zatherz> as it can be anything
<FromGitter> <redcodefinal> @zatherz hmm
<FromGitter> <zatherz> it can return 15 when the actual size is 0
<FromGitter> <zatherz> if you override it
<FromGitter> <zatherz> @redcodefinal this is definitely something you should use overloads on
<BlaXpirit> redcodefinal, I still have no idea what the problem is. everything seems correct
<FromGitter> <zatherz> using splats in this way is hacky when you have actual overloading
<FromGitter> <redcodefinal> Yeah I'm porting methods I wrote in Ruby and I am still learning the Crystal way, thanks for the help @BlaXpirit and @zatherz
<FromGitter> <zatherz> yeah, that's very ruby-like
<FromGitter> <zatherz> but very crystal-unlike :P
<FromGitter> <zatherz> is there a way to disable text emoticons from turning into emojis
<BlaXpirit> ah, the [0] is broken, that's... yeah
<FromGitter> <redcodefinal> to be honest I've been wanting that feature in ruby because I think it's dumb that I need to case it out like that
<BlaXpirit> zatherz, there is absolutely no way to do that in gitter
<FromGitter> <zatherz> yeah
<FromGitter> <redcodefinal> but ruby doesnt really support overloads in any context so I've learned to get by without them
<BlaXpirit> but i do hacks in my bridge bot :p
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <zatherz> ```$ echo ":p" | xxd ⏎ 00000000: 3ae2 81a0 700a :...p.``` [https://gitter.im/crystal-lang/crystal?at=581a538eeed0c3125f2b58f4]
<FromGitter> <sdogruyol> @BlaxPirit i like your bot
<FromGitter> <zatherz> BlaxpIrit
<FromGitter> <zatherz> test :￰P
<BlaXpirit> please don't test this stuff here though :/
<FromGitter> <zatherz> BlaXpirit: why are you using 3 characters?
<FromGitter> <zatherz> just use a 200B
<BlaXpirit> uhm it's probably 3 utf-8 bytes. it is just a '\u{2060}'
sustained has joined #crystal-lang
<FromGitter> <johnjansen> @redcodefinal does this make it any clearer? https://play.crystal-lang.org/#/r/1d85
<FromGitter> <zatherz> what terminal are you using
<FromGitter> <zatherz> Papierkorb ^
<Papierkorb> Don't think my terminal has anything to do with crystal (or spec2 or w/e) going nuts
<FromGitter> <zatherz> Papierkorb: you mean the `` stuff?
<Papierkorb> piped it into a file for easier reading, and crystal decides to still put out ANSI sequences
<Papierkorb> No I mean it instantiating something recursively because .. it can?
<FromGitter> <redcodefinal> ```"10095927258901442".to_i``` produces this wonderful bit. ⏎ ```code paste, see link``` ⏎ Is there a way to cast it to an Int64 instead? [https://gitter.im/crystal-lang/crystal?at=581a59c3e097df757561af98]
<FromGitter> <zatherz> @redcodefinal `to_i64`
<FromGitter> <redcodefinal> well that was easy
<FromGitter> <zatherz> `to_u32` for UInt32, `to_u64` for UInt64, `to_i8` for Int8, etc
<FromGitter> <redcodefinal> ah thats neato
<FromGitter> <zatherz> Papierkorb: is that for sure the full output?
<Papierkorb> zatherz, it is the full file as was given by $ crystal spec spec/torrent/bencode/lexer_spec.cr > wtf
<Papierkorb> however, github decided to add line breaks
<FromGitter> <zatherz> Papierkorb: `crystal -v`?
<Papierkorb> Crystal 0.19.4 (2016-10-07)
<FromGitter> <zatherz> Papierkorb: could you please try `crystal spec spec/torrent/bencode/lexer_spec.cr 2>&1 > wtf`?
<Papierkorb> line 98 is semantically what I have in the _spec.cr - Too bad that spec2 doesn't support doing [..].each{ it("..."){ .. } } like in RSpec
sustained has quit [Remote host closed the connection]
<Papierkorb> zatherz, crystal does not write anything to stderr
<Papierkorb> that's literally everything it tells me
<FromGitter> <zatherz> Papierkorb: is the code public somewhere?
<Papierkorb> Another gem from today was "type must be Pointer(Array(UInt32)), not Pointer(Array(UInt32))" - Though I was not able to reproduce this one. It happened with a StaticArray(ArrayAlias, SOME_CONST) in a class while building the default #inspect(io). Trying in `play` didn't yield something useful, there it always worked fine
<Papierkorb> zatherz, that's my WIP, see line 98 in the gist for what I do
<FromGitter> <zatherz> oh, just noticed that you linked the gist
<FromGitter> <zatherz> well yeah that's fucked
<FromGitter> <zatherz> Papierkorb: I don't know spec2 at all, so I can't really help. I'd suggest reporting it to spec2 first
<Papierkorb> Spec2 is basically benchmarking the compiler or something. Spec "1" worked fine
sustained has joined #crystal-lang
<FromGitter> <zatherz> yes, I'm on that page already
<FromGitter> <zatherz> Papierkorb: this seems fucky: ⏎ ```crystal
<FromGitter> <zatherz> Papierkorb: this seems fucky: ⏎ ```when this is the macro:``` [https://gitter.im/crystal-lang/crystal?at=581a5d0945c9e3eb43ee3153]
<FromGitter> <zatherz> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=581a5d112d4796175f378489]
bjz has joined #crystal-lang
<FromGitter> <zatherz> actually, nvm
<FromGitter> <zatherz> ah
<FromGitter> <zatherz> Papierkorb: `abstract def match(actual)`
<FromGitter> <zatherz> you're defining a matcher called `match`. register_matcher does a `def match`
<Papierkorb> To be frank, if you have a syntax error in the spec, the error reporting is awful
<FromGitter> <zatherz> it may be a collision related to that
<FromGitter> <zatherz> try `register_matcher(_match)` or something like that just to test the theory
<Papierkorb> zatherz, match(..) works fine for other specs
<FromGitter> <zatherz> you mean `register_matcher(match)`?
<Papierkorb> I'm not the author of spec2, nor do I use #register_matcher myself
<FromGitter> <zatherz> I see
<FromGitter> <zatherz> Papierkorb: could you try to reduce the whole project to the minimum required to trigger the error? remove any other specs that do work, and reduce the actual code
<FromGitter> <zatherz> Papierkorb: can't reproduce ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=581a6081e462097a30fed638]
<Papierkorb> zatherz, I found 4 bugs in the last hours, the above one being reproducable, one being a spec2 bug, and two where I have no clue how to reproduce
<FromGitter> <zatherz> `testtesttest_spec.cr` is that code of course
<Papierkorb> Are you on Crystal 0.19.4 (2016-10-07) too with spec2 at that commit? I'm on Linux x64
<Papierkorb> Crystal was installed from the ArchLinux repository
<FromGitter> <zatherz> Papierkorb: spec2 `eef5144d86f3aadf95811ffc0450be389db36fed`, crystal Crystal 0.19.4+51 [66f6970] (2016-10-22), Crystal from `crystal-git` in the AUR built on 22.10.2016
<Papierkorb> will try with crystal-git
bjz has quit [Ping timeout: 268 seconds]
matp has quit [Read error: Connection reset by peer]
matp has joined #crystal-lang
<Papierkorb> jeez, wish I would'
<Papierkorb> ve skipped the verification step. Don't care much about that right now -.-
<BlaXpirit> Papierkorb, much easier to just keep a folder
<BlaXpirit> git pull && make
<Papierkorb> zatherz, whatever it was, it's fixed in the recent git
Fichtenstein has quit [Quit: Fichtenstein]
<FromGitter> <redcodefinal> So how do you generate the documentation for a Crystal Shard? For example, the actual crystal repo has a commenting style similar to RDoc https://github.com/crystal-lang/crystal/blob/master/src/object.cr#L274
<Papierkorb> redcodefinal, $ crystal doc
<FromGitter> <redcodefinal> @Papierkorb Sweet thanks!
lacour has joined #crystal-lang
<crystal-gh> [crystal] maxpowa opened pull request #3495: Allow TCPSocket to bind to specific local address (master...tcpsocket-bind-local) https://git.io/vXZBS
sustained has quit [Remote host closed the connection]
<FromGitter> <redcodefinal> Question. I wrote a method in Ruby to pull values randomly from an Array using perlin noise. The method looks like this. ⏎ ```code paste, see link``` ⏎ In Ruby Arrays can hold any type, it doesn't matter, and can return any type of value so this works well. I need to write a similar method for Crystal. However, since Crystal wants you to type things, I'm not sure how to make this happen. Can Crystal's Array be used as
<FromGitter> ... an umbrella to catch all the other Array types ( like Array(Int32) or Array(String))? What about the return value? Theoretically, any Array of any type could go into it, and any type could come out. Would I make the return type a Generic of some sort? [https://gitter.im/crystal-lang/crystal?at=581a6acfe097df7575621711]
<Papierkorb> johnjansen, wish "add a badge" fulfilled :3
A124 has quit [Read error: Connection reset by peer]
<FromGitter> <redcodefinal> like maybe ⏎ ```code paste, see link``` ⏎ what would the return value be in that case, or would I leave out a return type and let Crystal decide? [https://gitter.im/crystal-lang/crystal?at=581a6b2deed0c3125f2be661]
<BlaXpirit> redcodefinal, you can always leave things out
<BlaXpirit> my recommendation: `def get_perlin_item(x : Int, array : Indexable(T)) : T`
<FromGitter> <redcodefinal> @BlaXpirit how would the call to that look? Would this be right? ⏎ ```x = [1,2,3] ⏎ get_perlin_item(0, x)``` ⏎ or would I need to specify the Generic type T when calling the method? [https://gitter.im/crystal-lang/crystal?at=581a6bc2e462097a30ff1271]
<BlaXpirit> it just works. like that, yes
A124 has joined #crystal-lang
<FromGitter> <redcodefinal> @BlaXpirit Ah sweet thanks for the suggestion, I'm going to go dig into the Indexable API Docs
<BlaXpirit> though now that i think about it the implicit T is deprecated. https://carc.in/#/r/1d89 will be the only way to have this T in the future
<FromGitter> <redcodefinal> @BlaXpirit lol right before I hit enter
<FromGitter> <redcodefinal> @BlaXpirit thanks man
<FromGitter> <redcodefinal> @BlaXpirit What was the reasoning behind this change?
<BlaXpirit> redcodefinal, issue is linked from the commit
<FromGitter> <redcodefinal> im a derp ty
shawn42 has quit [Quit: Connection closed for inactivity]