jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.0 | 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
Philpax has joined #crystal-lang
snsei has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
<jhass> BlaXpirit: just had a thought, the bot should probably have an option to ignore a Gitter and perhaps IRC user in the mid term, not sure how active ops are over there...
snsei has quit [Remote host closed the connection]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
matp has joined #crystal-lang
Oliphaunte has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
A124 has quit [Quit: '']
A124 has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
Oliphaunte has quit [Remote host closed the connection]
snsei has joined #crystal-lang
dgaff has joined #crystal-lang
<dgaff> Hey all - whats the crystal equivalent of 1.methods?
<dgaff> (the 1.methods being the list of available methods for an object in ruby)
<jhass> p {{Int32.methods.map(&.name.symbolize)}}
<jhass> pulling up the API docs is easier ;(
<jhass> er, ;)
<dgaff> gotcha - Yeah, I'm working with a mongo shard that looks pretty derelict, so I'm trying to figure out what the types were for everything. I am nearly up to the pieces for a crud API but there's still some weirdness with refreshing documents from the DB.
<dgaff> For instance, pulling back the documents, in order to collect some Integer field from the objects, without recasting them from whatever the hell the type is, I had to do something like `arr = [] of (BSON | BSON::Code | BSON::MaxKey | BSON::MinKey | BSON::ObjectId | BSON::Symbol | BSON::Timestamp | Bool | Float64 | Int32 | Int64 | Regex | String | Time | Nil)`
<dgaff> Which, obviously, isn't ideal.
<dgaff> This language looks stupid cool though. 10 years on Ruby has made me loathe the speed issues, and seeing Mike Perham put up a link about Sidekiq being ported is the thing that pushes me into crystal I think.
<jhass> I would expect an alias for that type to exist somewhere
<jhass> so BSON::Field
<dgaff> I seeeeee. Interesting.
<dgaff> Do you think there's some idiomatic way that one would then... recast?... that to an int or float or whatever, @jhass ?
<dgaff> Looks like perhaps #decode just below?
matp has quit [Remote host closed the connection]
<jhass> if you got a BSON::Field and know it's actually an say Int64, just foo.cast(Int64)
<jhass> er
<jhass> if you got a BSON::Field and know it's actually an say Int64, just foo.as(Int64)
<jhass> it's a bit late for me :)
<jhass> if you don't know and want nil back in case it's not an Int64 you can do foo.as?(Int64)
<dgaff> No worries, I'm just getting a handle of the little particulars that make this different from ruby - thankful to get a little help at all.
<crystal-gh> [crystal] 5t111111 opened pull request #2836: Fix example code for delegate (master...fix-delegate-example-code) https://git.io/vo4EN
pilne has quit [Quit: Quitting!]
<dgaff> No worries, I'm just getting a handle of the little particulars that make this different from ruby - thankful to get a little help at all.
<dgaff> Whoops, up and enter on wrong terminal screen.
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
havenn has joined #crystal-lang
havenn is now known as Guest61380
daneb has joined #crystal-lang
icezimm has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
daneb has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
daneb has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
raydf has joined #crystal-lang
raydf has quit [Ping timeout: 258 seconds]
raydf has joined #crystal-lang
raydf has quit [Ping timeout: 258 seconds]
raydf has joined #crystal-lang
snsei has quit [Remote host closed the connection]
sandelius has joined #crystal-lang
raydf has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
raydf has joined #crystal-lang
daneb has quit [Remote host closed the connection]
<BlaXpirit> jhass, hah such an ability would probably double the size of the source code. especially if you take into account persistence :(
<BlaXpirit> the bot can just be kicked
raydf has quit [Quit: Leaving]
daneb has joined #crystal-lang
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
soveran has joined #crystal-lang
PragTob has joined #crystal-lang
daneb_ has joined #crystal-lang
daneb has quit [Ping timeout: 250 seconds]
daneb has joined #crystal-lang
daneb_ has quit [Remote host closed the connection]
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
ruslux has joined #crystal-lang
ruslux has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
daneb has quit [Remote host closed the connection]
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<jhass> >> Crystal::VERSION
<DeBot> jhass: # => "0.18.0" - https://carc.in/#/r/11mv
<BlaXpirit> ^_^
<crystal-gh> [crystal] jhass closed pull request #2836: Fix example code for delegate (master...fix-delegate-example-code) https://git.io/vo4EN
<BlaXpirit> jhass, so arch still has 0.17.3??
<jhass> yeah, anatolik kinda missed the out of date notification I wrote for 0.17.4 with the solution how to update the package :/
matp has joined #crystal-lang
<BlaXpirit> cool, thanks
<jhass> BlaXpirit: personally I just get the PKGBUILD, edit it and set rel to 0
<jhass> that way when the official update comes I don't shadow it, but don't have to wait for it
<BlaXpirit> good
<BlaXpirit> well i just compile latest master all the time
<jhass> crystal-git is updated for sure ^.^
Guest___ has joined #crystal-lang
Guest___ is now known as greenarrow
luislavena has joined #crystal-lang
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
<travis-ci> crystal-lang/crystal#89a4843 (master - Merge pull request #2836 from 5t111111/fix-delegate-example-code): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137752066
snsei has quit [Ping timeout: 244 seconds]
sandelius has left #crystal-lang ["Textual IRC Client: www.textualapp.com"]
soveran has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
daneb has joined #crystal-lang
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
bjz has joined #crystal-lang
ome has joined #crystal-lang
daneb has quit [Ping timeout: 272 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
matp has quit [Remote host closed the connection]
sebasr has quit [Ping timeout: 250 seconds]
daneb has joined #crystal-lang
greenarrow has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matp has joined #crystal-lang
Guest__ has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 272 seconds]
sebasr has joined #crystal-lang
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
daneb has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
daneb has joined #crystal-lang
Guest80941 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
matp has joined #crystal-lang
trapped has joined #crystal-lang
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
daneb has quit [Remote host closed the connection]
daneb has joined #crystal-lang
Guest80941 has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
coderobe has joined #crystal-lang
<coderobe> Hey, i've noticed that something like `s = gets.split(",")` won't compile in crystal, instead it throws the error "undefined method 'split' for Nil (compile-time type is String?)". Is that intentional, not fully implemented or a bug?
<coderobe> If i try to set the type of `s` to string by doing `s : String` i get `declaring the type of a local variable is not yet supported`, too so i have no idea how to tell the compiler that this is going to be a string
<BlaXpirit> coderobe, it is intentional, because it is not guaranteed that `s` will always be a string
<BlaXpirit> coderobe, have you read http://crystal-lang.org/docs/ ?
<BlaXpirit> coderobe, foremost, because the return type of `gets` is String|Nil - in case there is an EOF (Ctrl+D) it returns nil
<BlaXpirit> so you can do: s = gets; if s; do_stuff; else; puts "wrong output"; end
<BlaXpirit> coderobe, you can also do s = gets.not_nil!.split(",") to raise a runtime error if it's nil, that won't be helpul to the user
snsei has joined #crystal-lang
<BlaXpirit> and by "wrong output" I meant "missing input"
<coderobe> I see
<coderobe> i'll try that, thanks!
<coderobe> Also, can i somehow grab user input one character at a time? gets is waiting on a line terminator
<coderobe> i'd like to be somehow able to immediately react to certain keys without waiting for the user to submit the action
Guest80941 has joined #crystal-lang
get_durnk has joined #crystal-lang
<BlaXpirit> coderobe, there is no easy cross-platform way to immediately react to a character, but with specialized libraries it can be done
snsei has quit [Ping timeout: 240 seconds]
<BlaXpirit> I don't know about any but there probably are some
<coderobe> Oh, that sample is very helpful. I'll look into that
<coderobe> again, thanks for the fast response
<jhass> coderobe: another approach you can do s = gets.try &.split(","), that way you either get the array or nil in s if Ctrl+D was pressed
Guest80941 has quit [Quit: Leaving]
Dreamer3_ has quit [Quit: Leaving...]
kochev has joined #crystal-lang
<coderobe> Another question related to gets: Is it possible to disable echoing of the input string, or to replace the echo method with something else?
<coderobe> Say i want to read a password or something else that might be confidental
icezimm has joined #crystal-lang
<jhass> I don't think we have anything in stdlib yet
<jhass> I just bound getpass(3) for the one case I needed it :/
<jhass> (which is deprecated even...)
<BlaXpirit> yup, i cant find anything either
<jhass> in theory the termios stuff is already there, so it shouldn't be tooo hard
<jhass> but idk how it interacts with libevent and stuff
<FromGitter> <k-solutions> Hello All, I just wonder if crystal run --debug is any useful for debugging currently ?
<BlaXpirit> @k-solutions I think --debug is the default, you just disable it with --release
<jhass> @k-solutions: with LLVM 3.5 it does generate source code annotations readable by gdb/lldb/valgrind for a lot of stuff already, so somewhat
<jhass> BlaXpirit: nope
<BlaXpirit> oh sorry then
<jhass> we even have a bug report open where something crashes with --debug but not without -.-
<BlaXpirit> jhass, do you wanna enable colors for this channel so the bot can show the names more nicely?
<jhass> we can try
<jhass> what a colorful world
<jhass> sorry
<BlaXpirit> looks so nice in gitter
<FromGitter> <k-solutions> Thanks, as I'm coming from ruby valgrand seems like nice choice, but could request some more info or howto link ?
<jhass> haha
<jhass> @k-solutions it's quite limited atm tbh, puts debugging gets your further for most stuff. Anything specific you're stuck on?
<FromGitter> <k-solutions> well I try to explore 0mq and I get stuck with it in some of the more complex code examples, and I guess I'm spoiled by pry but need a tool to trace my code execution
Arahael has joined #crystal-lang
Bish has quit [Read error: Connection reset by peer]
edjsu has quit [Ping timeout: 260 seconds]
icezimm has quit [Quit: Leaving.]
ome has quit [Quit: Connection closed for inactivity]
<get_durnk> can we add a link to the gitter to either the channel topic of the github readme?
<get_durnk> or*
<BlaXpirit> I don't know whether I'd be happy about that, but probably should be done
<jhass> get_durnk: I'd still like to keep clear that this is considered our blessed "chat" channel
<jhass> I think the people fanatic about using Gitter will find it
<get_durnk> right, but there is no mention anywhere of the gitter channel from anything crystal-official
<get_durnk> so is the gitter an official crystal 'thing'?
<jhass> I wouldn't say so
<BlaXpirit> well a random joe can't get ownership of crystal-lang/crystal room but
kochev has quit [Ping timeout: 250 seconds]
paulcsmith_ has joined #crystal-lang
icezimm has joined #crystal-lang
snsei has joined #crystal-lang
<shadowshell> Congrats on 0.18.0 folks! The `partial` method on `Proc` is rad af!
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
bcardiff has joined #crystal-lang
kochev has joined #crystal-lang
dgaff has quit [Ping timeout: 258 seconds]
Renich has joined #crystal-lang
<get_durnk> crystal is starting to look like a real language lately
daneb has quit [Remote host closed the connection]
<FromGitter> <asterite> So IRC can see this from gitter...?
<asterite> seems so :-)
<asterite> We could probably make that gitter place then official
daneb has joined #crystal-lang
daneb has quit [Remote host closed the connection]
<get_durnk> yup
<get_durnk> which would be highly confusing to a new user and should be mentioned somewhere, but whatever
daneb has joined #crystal-lang
Renich has quit [Ping timeout: 276 seconds]
<asterite> why confusing?
Renich has joined #crystal-lang
paulcsmith_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<get_durnk> because people in gitter wouldnt necessarily appear in user list on irc clients
<get_durnk> i dont know if whatever gitterbridge this is does highlighting, that could be irritating
daneb_ has joined #crystal-lang
<asterite> I see... well, but if someone enters gitter just to ask a quick question it'll still be helpful
<FromGitter> <asterite> ``` ⏎ [1, 2, 3].each do |i| ⏎ puts i ⏎ end ⏎ ``` [https://gitter.im/crystal-lang/crystal?at=57616891da1c26b0453655a5]
daneb_ has quit [Remote host closed the connection]
<pawnbox> NIce
<asterite> Wow, it looks beautiful in gitter
<pawnbox> With code highlighting.
<BlaXpirit> but it's ruby
<asterite> it's good enough :)
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voBwl
<crystal-gh> crystal/master f18f2b8 Ary Borenszweig: README: mention Gitter
daneb has quit [Ping timeout: 244 seconds]
<BlaXpirit> why not say they're linked together
PragTob has quit [Remote host closed the connection]
<FromGitter> <bcardiff> >> "DeBot via Gitter?"
<BlaXpirit> that would have to be specifically arranged
paulcsmith_ has joined #crystal-lang
<FromGitter> <bcardiff> yeap. Yet, the >> syntax renders wierd in Gitter.
bcardiff has quit [Quit: bcardiff]
fryguy9 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<get_durnk> man, that renders as like a unicode arrow in irc
<BlaXpirit> get_durnk, that's intentional
<get_durnk> its a bit ugly imo
<FromGitter> <tilpner> ``` ⏎ puts "Test code. Will be edited." ⏎ ```
fryguy9 has quit [Quit: Leaving.]
<BlaXpirit> yeah, if anyone finds an API for message edits on gitter, i'm all ears
<tilpner> You may consider also indicating edits. Yes, they add noise, but if someone asks for help on Gitter, then edits their code, you could end up talking about different snippets.
<BlaXpirit> I don't see any way to receive the edits
Philpax has quit [Ping timeout: 252 seconds]
<tilpner> The Gitter bridge does it, I don't know if they expose that.
<BlaXpirit> then it could be an option to connect to gitter bridge instead
<travis-ci> crystal-lang/crystal#f18f2b8 (master - README: mention Gitter): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137818423
Tuxified has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<shadowshell> Looks like all the packages for crystal on Archlinux are out of date or broken. The aur crystal-git won't build because the std/socket_spec.cr has 4 failures. I grabbed the official crystal package and attempted to update it to the latest official release. Guess what, same 4 tests fail. Is this a known issue, those failing test on a released version? Or
<shadowshell> something specific to arch?
<shadowshell> I'm happy to continue to dig into this and update those packages, but don't want to chase my tail :)
<coderobe> shadowshell: what about community/crystal ?
<shadowshell> out of date coderobe: `community/crystal 0.17.3-1`
<shadowshell> that is the one i attempted to update to 0.18.0-1
<shadowshell> but that release fails on 4 specs in arch
<BlaXpirit> shadowshell, i think crystal-git should work just find
<BlaXpirit> fine
<shadowshell> hmm, maybe my env is making it break somehow
<shadowshell> the spec i mean
<jhass> shadowshell: yeah the specs pass just fine for me for crystal-git
pawnbox has quit [Ping timeout: 250 seconds]
<coderobe> shadowshell: I'll attempt to build aur/crystal-git, will tell you if it breaks for me too
<jhass> I build the package before I update it :)
<asterite> jhass: how do I know when travis will run with 0.18.0?
<shadowshell> here is what i get
<jhass> asterite: does already
<shadowshell> i have nothing running on those ports
<asterite> jhass: great! but how can I know when it happens?
<jhass> asterite: the build should print the crystal version somewhere iirc?
<BlaXpirit> shadowshell, looks like broken ipv6?
<shadowshell> ha
<shadowshell> BlaXpirit: probably right
<jhass> asterite: https://hub.docker.com/u/jhass/ you can watch the timestamp of the latest tag of these
<shadowshell> i maybe disabled ipv6 because my isp is an ass wrgt it at the moment
<BlaXpirit> . . .
<shadowshell> but...not sure that should cause the package to fail to be installed....but that is a tough one
<asterite> jhass: excellent, thanks!
<shadowshell> how are you going to know what idiot out there disables ipv6 ;)
<jhass> shadowshell: it's probably because your /etc/hosts still has an entry for ::1
<shadowshell> ah, looking jhass
<BlaXpirit> jhass, shadowshell, that would fix the first failure but not the next ones
<jhass> well yeah
<jhass> ipv6 is the future, disable ipv4 instead!
<BlaXpirit> shadowshell, breaking ipv6 is not the way to go, I don't see why you would do that
* jhass vanishes
<shadowshell> you are correct on that account: `::1 localhost.localdomain localhost`
<shadowshell> heh
<shadowshell> i know you are right
<shadowshell> now tell my isp
<BlaXpirit> my isp doesn't pass on ipv6 traffic but that doesn't mean i should break it locally
<BlaXpirit> shadowshell, you can edit pkgbuild and remove spec from it
<coderobe> afaik linux doesn't care if your isp doesn't speak ipv6
<jhass> I just bypass my ISP, tunnelbroker.net endpoint on my router, done
<jhass> home network thinks it has full DS
<shadowshell> coderobe: it does when they advertise ipv6 dns servers that don't work!
<shadowshell> and i kept forgetting
<shadowshell> so i just disabled ipv6 for now...brute...wrong..works
<jhass> eh sounds again like something you should be able to fix in the router
<shadowshell> it is, totally
<shadowshell> i'm just kept dealing with and got mean to myself
<shadowshell> not your problem :)
<jhass> :)
<shadowshell> thanks for the pointers
<shadowshell> and yes, i totally disabled specs in PKGBUILD to get past it
<shadowshell> but thought it might be a real thing
<shadowshell> thanks again!
<jhass> shadowshell: makepkg --nocheck ;)
tilpner has quit [Quit: :wq]
tilpner has joined #crystal-lang
<coderobe> so i tried (and failed) to write a getch / gets method with input masking support https://gist.github.com/coderobe/5b443560287f540e06b6216f141c79fd - for some reason the del_chars method doesn't work when the input is masked & only triggers after the second keypress
<jhass> ah I don't think that's the correct approach, setting noecho through termios would be
<jhass> your issue is probably related do to STDOUT buffering or libevent delaying it or so
<jhass> yes termios is a terrible API :/
tilpner has quit [Quit: :wq]
<coderobe> console.cr doesn't seem useful at all
<coderobe> and i cannot flush STDOUT because .flush is defined as a no-op
tilpner has joined #crystal-lang
<jhass> idk, did we put STDOUT in synchronous mode?
matp has quit [Ping timeout: 276 seconds]
paulcsmith_ has joined #crystal-lang
<coderobe> I believe my issue really is related to stdout buffering, because calling `print ""` immediately after del_chars refreshes stdout properly
<BlaXpirit> coderobe, well maybe it is. flush it until it works
<coderobe> Huh, thats weird. When calling pipe.print "" inside of del_chars i get a compiler error, doing it right after calling del_chars works though
<BlaXpirit> coderobe, something about the return value?
<BlaXpirit> what is del_chars anyway
<coderobe> A method from the gist i linked a few messages ago
<coderobe> Yeah, the compiler error was the return value.
<coderobe> I think i found a bug though
<coderobe> STDOUT.print "asdf" does not refresh the terminal until a standalone `print` (or an alternative) is called
<BlaXpirit> coderobe, it's called buffering
<coderobe> Buffering without a flush method is kinda counterproductive
<coderobe> Oh.
<BlaXpirit> coderobe, u may have missed it because it's in inherited methods but i dont know
<coderobe> Missed the "Buffered" sub-page
<jhass> to be clear STDOUT is actually a FileDescriptorIO ;)
<coderobe> Good to know
<jhass> asterite: did you already drop the Crystal::VERSION == "0.18.0" stuff locally?
<FromGitter> <jwoertink> This is sweet!
soveran has quit [Remote host closed the connection]
<BlaXpirit> message count in gitter has probably doubled by now
<jhass> more like 10 times :P
<FromGitter> <jwoertink> I have a question about an error I was getting yesterday. I was having trouble understanding what it was telling me
<FromGitter> <jwoertink> `must be String, not String?`
<jhass> String? is the same as String|Nil
<FromGitter> <jwoertink> So the second one is more like a union?
<jhass> so you probably didn't initialize an instance var somewhere or tried to assign nil to something you declared to be String otherwise
<jhass> not like, it is one
<FromGitter> <jwoertink> lol. :thumbsup: gotcha. Ok. I had a method that I was writing a spec for which would return string, but since I wasn't done, there was an edge case where it returned nil
<txdv> hello?
<BlaXpirit> txdv, hello
Guest__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<FromGitter> <jwoertink> I read somewhere that you can use lldb and then compile with a `--debug` flag to debug your apps. Is there anything similar when running `crystal spec`?
<coderobe> jwoertink: "[--debug] is quite limited atm, puts debugging gets you further for most stuff"
<jhass> heh I get quoted! am I famous now?
pawnbox has joined #crystal-lang
<coderobe> ;)
<FromGitter> <jwoertink> Yeah, that's what I'm doing at the moment. My only issue was the method I was debugging kept throwing that `must be String, not String?` error instead of running my `puts`. Overall not bad, I was just curious if there was a better "undocumented" way. Thanks!
<jhass> @jwoertink: well that's a compile time error, so you don't even get a binary you could debug with lldb not mater whether you add --debug or not ;)
<FromGitter> <jwoertink> I do like that it really makes me focus on my method design. :smile:
ruslux has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ruslux> Thanks for .18!
dgaff has joined #crystal-lang
get_durnk has quit [Ping timeout: 250 seconds]
<coderobe> Are there any known shards that bind (n)curses?
<coderobe> "Usage: TODO: Write usage instructions here" lol
<coderobe> Yeah no, the one listed on crystalshards only binds initscr :|
paulcsmith_ has joined #crystal-lang
<dgaff> Is there a good way to run a debugger in kemal currently? The crystal equivalent of binding.pry?
Oliphaunte has quit [Remote host closed the connection]
pilne has joined #crystal-lang
<jhass> coderobe: time for your quote!
<coderobe> dgaff: "puts debugging gets you further for most stuff"
<coderobe> ;)
Oliphaunte has joined #crystal-lang
<dgaff> coderobe: fair enough!
snsei has quit [Remote host closed the connection]
ruslux has quit [Ping timeout: 244 seconds]
<jhass> ?shards=Shards is Crystals package manager and comes with it! You can find a list of shards (and Crystal projects in general) at http://crystalshards.xyz/, see https://github.com/crystal-lang/shards/ for a brief usage description.
<DeBot> jhass: Set shards.
<jhass> ?debugging=If you're using LLVM 3.5 there's experimental debugging support available via the --debug flag to crystal compile. It makes the source location of many expressions available to tools like lldb, gdb or valgrind. You can also call debugger in your code to add a debug trap. However most of the time it's easier to use the pp macro and similar.
<DeBot> jhass: Set debugging.
Oliphaunte has quit [Remote host closed the connection]
tomchapin has joined #crystal-lang
luislavena has quit [Quit: Leaving]
ruslux has joined #crystal-lang
<coderobe> take a look @ this
<jhass> yup compiler bug
<jhass> could you try to reduce the code and report it?
<coderobe> jhass: this is the entire bug https://my.mixtape.moe/whvoye.png, should i report it or is this already known?
<jhass> doesn't seem familiar
<jhass> seems like a parser error
<jhass> I wonder what the AST for that looks like
<jhass> btw sharing code with screenshots is... mmmh :P
<coderobe> yeah i know i know
<coderobe> it's only 4 lines tho
Oliphaunte has joined #crystal-lang
<coderobe> removing the second assignment from the code "fixes" the compiler error, instead it'll tell you " declaring the type of a local variable is not yet supported"
<coderobe> def bug x : String = "asd" end
<coderobe> vs def bug x : String, y = ["asd",1] end
<jhass> yes yes, definitely a bug, please open an issue ;)
<coderobe> will do
<jhass> def bug
<jhass> x : Int32, y = 1
<jhass> end
<jhass> bug
<jhass> seems enough btw
<jhass> takes complex types such as array and string out of the mix
Oliphaunte has quit [Ping timeout: 250 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/voRUe
<crystal-gh> crystal/master 7977b77 Ary Borenszweig: OAuth2: define `new(JSON::PullParser)` on access token subclasses so they can be deserialized too
<crystal-gh> crystal/master 71bca5d Ary Borenszweig: Removed Crystal version checks
<FromGitter> <jmoriau> hi, I just updated to 0.18.0 (ubuntu 14.04) and running `crystal spec` now gives me ⏎ /usr/bin/ld: cannot find -lxml2 ⏎ collect2: error: ld returned 1 exit status ⏎ Error: execution of command failed with code: 1: `cc -o "/home/user/.cache/crystal/crystal-run-spec.tmp" "${@}" -rdynamic -L/usr/lib -L/usr/local/lib -lz `pkg-config --libs libssl || echo -n -lssl -lcrypto` `pkg-config --libs libcrypto || echo -n -lcrypto`
<FromGitter> ... -lxml2 -lpcre -lm -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl` [https://gitter.im/crystal-lang/crystal?at=57619740da1c26b045366b51]
<FromGitter> <jmoriau> any idea ?
<Davy_CC> asterite: can Crystal-TW also translate posts in the crystal blog? I saw the CC0 license under docs/ but not in / or api/
<jhass> @jmoriau mh, we never shipped libxml2 afaik, so this should have failed before the same way. Anyway make sure libxml2-dev is installed
<FromGitter> <jmoriau> @jhass I literally ran spec 1 min before and it worked fine :/ gonna try to install it!
<BlaXpirit> could be as simple as... xml wasn't used in any spec
<jhass> ah right I know what it is
<jhass> the new junit formatter
<FromGitter> <jmoriau> @jhass I indeed didnt have it installed, it works now :+1: thanks!
zodiak_ has joined #crystal-lang
ruslux has quit [Ping timeout: 260 seconds]
zodiak has quit [Ping timeout: 252 seconds]
daneb has joined #crystal-lang
<FromGitter> <k-solutions> Hi All, any idea when crystal is getting out of Alfa ?
<jhass> I would actually call it Beta by now personally
<BlaXpirit> nope
<Davy_CC> I notices that `array[2, 3]` equals to `array[2] = 3`?
<jhass> but either is pretty meaningless, nothing will be stable before 1.0
<jhass> Davy_CC: nope?
<FromGitter> <k-solutions> Also Elixir has this super cool pipe operator |> which Matz also implementing in his Stream play-language :)
<BlaXpirit> hm yeah, whenever there is method calling without brackets, such an operator is quite important
<jhass> Davy_CC: ^
fnux has quit [Ping timeout: 264 seconds]
<jhass> BlaXpirit: @k-solutions see https://github.com/crystal-lang/crystal/issues/1388
toydestroyer has quit [Ping timeout: 264 seconds]
Renich has quit [Ping timeout: 250 seconds]
<FromGitter> <k-solutions> great, thanks
<Davy_CC> ohhhhh i made a mistake when I'm reading the new part of the docs
<Davy_CC> sorry
fnux has joined #crystal-lang
toydestroyer has joined #crystal-lang
<jhass> no worries
fryguy9 has joined #crystal-lang
Nik736 has joined #crystal-lang
fryguy9 has quit [Quit: Leaving.]
fryguy9 has joined #crystal-lang
<64MAAF5EY> crystal-lang/crystal#71bca5d (master - Removed Crystal version checks): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137868037
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/voRmS
<crystal-gh> crystal/master fd0f67b Jonne Haß: Removed some TODOs for Crystal 0.18
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
ruslux has joined #crystal-lang
<dgaff> Any thoughts on coercing a JSON::Any to a Hash?
<jhass> .as_h
<dgaff> wooooo
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<coderobe> wait, crystal has JSON?
<jhass> of course
<jhass> 3 or 4 variants by now?
<jhass> JSON.parse, JSON.mapping, JSON::PullParser...
<coderobe> ... i just wrote my own json parser like 3 minutes ago
<coderobe> good job me
<jhass> lol
daneb has quit [Remote host closed the connection]
<coderobe> lol indeed
<jhass> "parser" *cough*
<jhass> :P
<coderobe> hey, it works
<coderobe> :P
<FromGitter> <zcassini> I'm getting an error trying to get crystal_lib to work. ⏎ ``` ⏎ crystal src/main.cr -- examples/lib_curses.cr ⏎ Error in ./src/main.cr:6: instantiating 'Crystal::ASTNode+#transform(CrystalLib::LibTransformer)' ⏎ ``` ⏎ ive tried it with crytsal version 18, 17.4, 16 and get the same error. Anyone know what I'm doing wrong here? [https://gitter.im/crystal-lang/crystal?at=5761a2f036c83a880206021f]
daneb has joined #crystal-lang
daneb has quit [Client Quit]
daneb has joined #crystal-lang
matp has joined #crystal-lang
<BlaXpirit> @zcassini that's not the whole error, is it?
Oliphaunte has joined #crystal-lang
Tuxified has quit [Quit: Textual IRC Client: www.textualapp.com]
<travis-ci> crystal-lang/crystal#fd0f67b (master - Removed some TODOs for Crystal 0.18): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137881181
<FromGitter> <zcassini> @FromIRC the whole thing: ⏎ ``` ⏎ transformed = node.transform visitor ⏎ ^~~~~~~~~ ⏎ ⏎ in /home/zac/.anyenv/envs/crenv/versions/0.17.4/src/compiler/crystal/syntax/transformer.cr:7: instantiating 'CrystalLib::LibTransformer#transform(Crystal::ASTNode+)' ⏎ ⏎ node = transformer.transform self ⏎ ^~~~~~~~~ ⏎ ⏎ in ./src/crystal_lib/lib_transformer.cr:17:
<FromGitter> ... instantiating 'process_includes()' ⏎ ⏎ headers, flags, prefixes, remove_prefix = process_includes ⏎ ^~~~~~~~~~~~~~~~ ⏎ ⏎ in ./src/crystal_lib/lib_transformer.cr:36: instantiating 'Array(Crystal::Attribute)#each()' ⏎ ⏎ @includes.each do |attr| ⏎ ^~~~ ⏎ ⏎ in /hom ... [https://gitter.im/crystal-lang/crystal?at=5761a4127a851b587e6f2705]
<coderobe> @zcassini there's no arg.raise
<coderobe> if you want to raise an exception omit the `arg.`
<FromGitter> <zcassini> @coderobe cool. let me try ripping that out of crystal_lib
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Read error: Connection reset by peer]
daneb has left #crystal-lang [#crystal-lang]
<BlaXpirit> @zcassini, no, that's not the problem
<BlaXpirit> the actual problem is what's actually written, on the last line
<coderobe> BlaXpirit: would the compiler still say `undefined method 'raise' for...` if that was the case?
<coderobe> seems off imo
<BlaXpirit> coderobe, yeah it is off but something unusual is happening
<coderobe> i see
<BlaXpirit> coderobe, normally that would work, i think arg.raise is just a method that does raise with additional info
Nik736 has joined #crystal-lang
<BlaXpirit> if I remember correctly, crystal_lib requires like an empty lib with some annotations, right? @zcassini well, something is probably wrong with the base file you're feeding it
<FromGitter> <zcassini> @blaxpirit i tried a few of the example fiels and had the same problem. i didnt try them all though.
<BlaXpirit> I don't know... maybe it needs to be started differently
ruslux has quit [Ping timeout: 264 seconds]
<FromGitter> <zcassini> i'll open an issue on github for it. thanks
<BlaXpirit> @zcassini, hm no I really think we need to debug it, we need to find out how you're running it
<BlaXpirit> @zcassini maybe go to gist.github.com and paste all the puzzle pieces, like the header you're feeding it, the base crystal lib file, the command you're running
<FromGitter> <zcassini> @blaxpirit ok
<coderobe> what am i doing wrong? https://my.mixtape.moe/kdwqrb.png (see the LoC @ the bottom)
<jhass> probably a compiler bug
<BlaXpirit> coderobe, please paste that one line not as an image :( even right here
<coderobe> pp v.split("").map { |ch| ch == ch.downcase ? ch : "_#{ch.downcase}" }.join("")
<BlaXpirit> I think even it alone will be enough to prove a compiler bug
<coderobe> v == "asdfGhjkl" and it should become "asdf_ghjkl"
fryguy9 has quit [Quit: Leaving.]
<jhass> >> pp v.split("").map { |ch| ch == ch.downcase ? ch : "_#{ch.downcase}" }.join("")
<DeBot> jhass: Syntax error in expanded macro: pp:2: unterminated parenthesized expression - https://carc.in/#/r/11pq
<BlaXpirit> >> pp v.map { a ? a : a }
<DeBot> BlaXpirit: Syntax error in expanded macro: pp:2: unterminated parenthesized expression - https://carc.in/#/r/11pu
<coderobe> that bot is rad
matp has quit [Ping timeout: 250 seconds]
<BlaXpirit> yes but i can't quite grasp what it doesn't like
<BlaXpirit> I guess it's the do-end inside #{ }
<jhass> not quite, "#{(v.foo do end)}" is fine
<jhass> https://carc.in/#/r/11qb still is too
<BlaXpirit> >> puts "#{ (v.map do; a; end) }"
<DeBot> BlaXpirit: Syntax error in eval:21: unterminated parenthesized expression - https://carc.in/#/r/11qo
<BlaXpirit> funny part is, that 'puts' call is needed
<BlaXpirit> well, any call
<jhass> yeah, found that out now too
<BlaXpirit> and it has to be do-end
<jhass> who wants to open the issue? :P
<coderobe> i can do it
<coderobe> ;)
<BlaXpirit> but what causes it? it drives me mad
<jhass> nvm I'll open
<jhass> coderobe: in the meantime use p, it should work
<coderobe> alright
<BlaXpirit> TIL: `a?b:c` is exactly the same as `if a; b; else; c; end"
<BlaXpirit> never quite realized that
<coderobe> the magic of ternary operators
<BlaXpirit> well no, it's not the ternary operator, other language don't have this equivalence
<BlaXpirit> I mean you can literally exchange one for the other in any code and it'll still work work
<BlaXpirit> in C or JS you can't do that
<jhass> I think Ruby has it too
<BlaXpirit> probably
<jhass> not sure for all cases, it's sometimes inconsistent with things like constant assignment and referring to the constant inside the expression
<jhass> so I could imagine Foo = Foo ? Foo : Foo to behave differently than Foo = if Foo; Foo; else; Foo; end; but I didn't check
<jhass> perhaps even for locals
pawnbox has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<BlaXpirit> @zcassini, I'm sorry, you're totally right. I just got an opportunity to try it out and I got the same error
<Yxhuvud> PHP almost has the same behavior regards to ?:, except it has a difference precendence so if you nest it you get a totally different behavior.
<FromGitter> <zcassini> @BlaXpirit well at least i know i'm not doing it wrong.
<jhass> Yxhuvud: you can do $foo = if(true) { 1 } else { 2 }; in PHP?
<Yxhuvud> dunno, but it has ?:, but with different precendence of the : compared to every other language that also have ?:
<jhass> well the entire point is that it's equivalent by that working
<BlaXpirit> no, does not work like that
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
tomchapin has joined #crystal-lang
<FromGitter> <k-solutions> Anyone tried out to compile crystal for ARM ?
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> oh, asterite discovered githubs milestone feature
icezimm has quit [Ping timeout: 252 seconds]
<coderobe> told ya!
<coderobe> :P
<BlaXpirit> well I knew that it had to make sense but yeah
soveran has quit [Remote host closed the connection]
<FromGitter> <k-solutions> @jhass thanks, good read
Dreamer3 has joined #crystal-lang
kochev has quit [Remote host closed the connection]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tomchapin has joined #crystal-lang
matp has joined #crystal-lang
Philpax has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <zcassini> After the update I still have problems with crystal-lib. ⏎ ```` ⏎ crystal src/main.cr -- examples/lib_curses.cr ⏎ /usr/bin/ld: /opt/crystal/embedded/lib/../lib/libgc.a(os_dep.o): undefined reference to symbol '_end' ⏎ //usr/lib/x86_64-linux-gnu/libffi.so.6: error adding symbols: DSO missing from command line ⏎ collect2: error: ld returned 1 exit status ⏎ ``` ⏎ I have libffi6, libffi-dev, libffi6:i386 and libffi6-dbg
<FromGitter> <zcassini> ``` ⏎ Error: execution of command failed with code: 1: `cc -o "/home/zac/.cache/crystal/crystal-run-main.tmp" "${@}" -rdynamic -L/usr/lib -L/usr/local/lib `llvm-config-3.8 --ldflags 2>/dev/null || llvm-config-3.5 --ldflags 2>/dev/null || llvm-config --ldflags 2>/dev/null` -lclang -lpcre -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl` ⏎ ``` ⏎ I switched it to llvm 3.8 as 3.6 was giving me an error.
<jhass> llvm 3.8 is not supported, only 3.5 and 3.6 are
<FromGitter> <zcassini> ``` ⏎ /usr/bin/ld: /opt/crystal/embedded/lib/../lib/libgc.a(os_dep.o): undefined reference to symbol '_end' ⏎ //usr/lib/x86_64-linux-gnu/libLLVM-3.6.so.1: error adding symbols: DSO missing from command line ⏎ collect2: error: ld returned 1 exit status ⏎ Error: execution of command failed with code: 1: `cc -o "/home/zac/.cache/crystal/crystal-run-main.tmp" "${@}" -rdynamic -L/usr/lib -L/usr/local/lib `llvm-config-3.6
<FromGitter> ... --ldflags 2>/dev/null || llvm-config-3.5 --ldflags 2>/dev/null || llvm-config --ldflags 2>/dev/null` -lclang -lpcre -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl` ⏎ ``` ⏎ I get this error with 3.6 [https://gitter.im/crystal-lang/crystal?at=5761c96c52352c8402828ce0]
Philpax has quit [Ping timeout: 252 seconds]
<FromGitter> <zcassini> ``` ⏎ llvm-config-3.6 --version ⏎ 3.6.2 ⏎ ``` [https://gitter.im/crystal-lang/crystal?at=5761caf063ea0987306b4b80]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
dgaff has quit [Ping timeout: 252 seconds]
soveran has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 7 new commits to master: https://git.io/voRdU
<crystal-gh> crystal/master 40a0fca Ary Borenszweig: Fixed #2840: transform methods on abstract class and modules without subtypes to untyped expressions
<crystal-gh> crystal/master 1c5e6f1 Ary Borenszweig: Fixed #2844: Bug when rescueing exception using method argument
<crystal-gh> crystal/master 7773609 Ary Borenszweig: MemoryIO: raise if closed on read and clear
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
havenn has joined #crystal-lang
havenn has quit [Changing host]
havenn has joined #crystal-lang
justinmcp_ has joined #crystal-lang
benner_ has joined #crystal-lang
pabs_ has joined #crystal-lang
pleiosau1 has joined #crystal-lang
wmoxam_ has joined #crystal-lang
badeball_ has joined #crystal-lang
slash_ni1k has joined #crystal-lang
asterite_ has joined #crystal-lang
bazaar_ has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
<travis-ci> crystal-lang/crystal#86e6f19 (release/0.18 - Fixed #2835: alias didn't allow metaclasses in unions): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137939284
adam^ has joined #crystal-lang
tubbo` has joined #crystal-lang
g3funk has joined #crystal-lang
tubbo has quit [*.net *.split]
braidn has quit [*.net *.split]
bazaar has quit [*.net *.split]
havenwood has quit [*.net *.split]
justinmcp has quit [*.net *.split]
dom96 has quit [*.net *.split]
dzv has quit [*.net *.split]
asterite has quit [*.net *.split]
pabs has quit [*.net *.split]
wmoxam has quit [*.net *.split]
slash_nick has quit [*.net *.split]
pleiosaur has quit [*.net *.split]
benner has quit [*.net *.split]
adam12 has quit [*.net *.split]
mose has quit [*.net *.split]
badeball has quit [*.net *.split]
tubbo` is now known as tubbo
havenn is now known as havenwood
dom96 has joined #crystal-lang
asterite_ is now known as asterite
<travis-ci> crystal-lang/crystal#b1bbefc (master - Fixed #2835: alias didn't allow metaclasses in unions): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137939417
dzv has joined #crystal-lang
mose has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tomchapin has quit [Ping timeout: 250 seconds]