jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.1 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
waterlink has quit [Ping timeout: 246 seconds]
vikaton has joined #crystal-lang
<vikaton> to what extent can you malloc on a 512 mb ram vps
Cidan is now known as zz_Cidan
zz_Cidan is now known as Cidan
Cidan is now known as zz_Cidan
bcardiff has joined #crystal-lang
Sadin has quit [Ping timeout: 264 seconds]
DerisiveLogic has quit [Ping timeout: 276 seconds]
willlll has quit [Quit: willlll]
zz_Cidan is now known as Cidan
Sadin has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
willlll has joined #crystal-lang
willlll has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 240 seconds]
JBat has joined #crystal-lang
havenwood has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
Sadin has quit [Ping timeout: 264 seconds]
havenwood has quit []
BlaXpirit has joined #crystal-lang
unshadow has joined #crystal-lang
<unshadow> Hi guys, I just found out about this lanuage, as a ruby user this is amaizing for me ! thanks for the hard work
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
strcmp1 has quit [Ping timeout: 276 seconds]
Ven has quit [Ping timeout: 245 seconds]
datanoise has quit [Ping timeout: 276 seconds]
Ven has joined #crystal-lang
JBat has quit [Quit: Computer has gone to sleep.]
Ven has quit [Read error: Connection reset by peer]
BlaXpirit has quit [Quit: Quit Konversation]
Ven has joined #crystal-lang
datanoise has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
datanoise has quit [Ping timeout: 256 seconds]
leafybasil has quit [Remote host closed the connection]
Ven has quit [Ping timeout: 272 seconds]
<unshadow> So, Is there an IRB like functunality in crystal ?
<jhass> no, it's pretty hard to do, especially since it's no JIT language
<jhass> crystal eval is as good as it gets for now
<jhass> >> "we also have an eval bot that you're free to use in a query"
<DeBot> jhass: "we also have an eval bot that you're free to use in a query"
<unshadow> >> a = "testing"; puts a
<DeBot> unshadow: testing
<unshadow> nice
JBat has joined #crystal-lang
leafybasil has joined #crystal-lang
<unshadow> What about a GEM like options ? is there an automatic way to install repos ?
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
Ven has joined #crystal-lang
<jhass> yes, though veery basic
<jhass> https://github.com/jhass/github_desktop_notifications/blob/master/Projectfile like this, when you run crystal deps it'll clone the listed repos and symlink them into the load path, that's all for now
<jhass> well, it also takes local paths
<unshadow> I see, its like a remote Makefile of a sort
<jhass> mh, no, it's not build instructions
<jhass> it's closer to a very basic Rubygems really
Cidan is now known as zz_Cidan
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 272 seconds]
leafybas_ has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
strcmp1 has joined #crystal-lang
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 256 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
<unshadow> Is there a way to add Crystal to the RVM manager ? maybe talk to them and add it ?
<jhass> I doubt that would be a good idea atm tbh
<unshadow> why ?
<jhass> Crystal is its very own language, not an implementation of Ruby. Having it in a "Ruby version manager" seems wrong
<jhass> besides none of RVMs features would be useful to it
<unshadow> yeha... TBH it does sounds silly , my bad :)
vikaton has joined #crystal-lang
<vikaton> how do I split a string but the nth character?
<vikaton> like '123456789' every 2
<unshadow> What's the string, and what's the expected result ?
<vikaton> >> '123456789'.scan(/.{1,2}/m)
<DeBot> vikaton: Syntax error in eval:3: unterminated char literal
<vikaton> >> "123456789".scan(/.{1,2}/m)
<DeBot> vikaton: [#<MatchData "12">, #<MatchData "34">, #<MatchData "56">, #<MatchData "78">, #<MatchData "9">]
<vikaton> >> "123456789".scan(/.{1,2}/m).to_s
<DeBot> vikaton: "[#<MatchData \"12\">, #<MatchData \"34\">, #<MatchData \"56\">, #<MatchData \"78\">, #<MatchData \"9\">]"
<vikaton> unshadow: Like that but without the MatchData stuff :/
<unshadow> "123456789".scan(/.{1,2}/m).to_a
<unshadow> >> "123456789".scan(/.{1,2}/m).to_a
<DeBot> unshadow: [#<MatchData "12">, #<MatchData "34">, #<MatchData "56">, #<MatchData "78">, #<MatchData "9">]
<jhass> >> "123456789".split(/(?:..)/)
<DeBot> jhass: ["", "", "", "", "9"]
<jhass> >> "123456789".split(/(?<=..)/)
<DeBot> jhass: ["12", "3", "4", "5", "6", "7", "8", "9"]
<jhass> mh
<jhass> worth a try :P
<vikaton> I thought scan was fixed :/
<jhass> yeah, stick to scan, just map out the first capture
<vikaton> oh wait..
<jhass> >> "123456789".scan(/..?/, &.first)
<DeBot> jhass: in line 3: undefined method 'first' for MatchData
<jhass> >> "123456789".scan(/..?/).map &.first
<DeBot> jhass: Error in line 3: undefined method 'first' for MatchData
<jhass> >> "123456789".scan(/..?/).map &.[0]
<DeBot> jhass: ["12", "34", "56", "78", "9"]
<vikaton> o
detox has joined #crystal-lang
<vikaton> >> '123456789'.scan(/.{1,2}/m)
<DeBot> vikaton: Syntax error in eval:3: unterminated char literal
<detox> vikaton: Syntax error in ./exec.cr:1: unterminated char literal
<vikaton> >> "123456789".scan(/.{1,2}/m)
<DeBot> vikaton: [#<MatchData "12">, #<MatchData "34">, #<MatchData "56">, #<MatchData "78">, #<MatchData "9">]
<detox> vikaton: You have not printed anything
<vikaton> >> p "123456789".scan(/.{1,2}/m)
<DeBot> vikaton: [#<MatchData "12">, #<MatchData "34">, #<MatchData "56">, #<MatchData "78">, #<MatchData "9">]
<detox> vikaton: [#<MatchData "12">, #<MatchData "34">, #<MatchData "56">, #<MatchData "78">, #<MatchData "9">]
<vikaton> w0w
detox has quit [Remote host closed the connection]
<vikaton> is DeBot 0.6.1 ?
<jhass> no
<vikaton> oh, thought it was
<jhass> >> `crystal --version`
<DeBot> jhass: "Crystal 0.7.1 (Fri May 1 08:07:54 UTC 2015)\n"
<vikaton> I thought scan was fixed
<jhass> what's broken?
<vikaton> It prints out MatchData
<jhass> that's intended
<vikaton> for what reason
<jhass> so you can access it
<jhass> without resorting to fugly pseudo global
<jhass> s
<unshadow> "123456789".scan(/.{1,2}/m)[1]
<unshadow> >> "123456789".scan(/.{1,2}/m)[1]
<DeBot> unshadow: #<MatchData "34">
<unshadow> >> "123456789".scan(/.{1,2}/m)[1][1]
<DeBot> unshadow: IndexOutOfBounds: Index out of bounds
<unshadow> >> "123456789".scan(/.{1,2}/m)[1][0]
<DeBot> unshadow: "34"
<unshadow> here
<vikaton> w0w
<vikaton> ok nice
<vikaton> >> "123456789".scan(/...?/).map &.[0]
<DeBot> vikaton: ["123", "456", "789"]
<vikaton> nice
<unshadow> :)
<vikaton> uh, Arrays dont work well with .each correct ?
<jhass> incorrect
<vikaton> o
BlaXpirit has joined #crystal-lang
<vikaton> I see why
<vikaton> >> x :: String; x+="hi"; x
<DeBot> vikaton: Could not open /dev/zero
<vikaton> ?
<jhass> interesting :D
<jhass> x :: String is unsafe, it's not initialized properly
<jhass> it points to garbage
<vikaton> Why isnt it just an empty string :(
<jhass> because that would be expensive
<jhass> and you really don't need that construct in regular code
<jhass> just x = ""
<jhass> that snippet segfaults over here, so it's really just random behavior
<vikaton> Yeah that's why my app was acting weird
datanoise has joined #crystal-lang
<vikaton> >> '!'.ord.to_s(2).length
<DeBot> vikaton: 6
<vikaton> >> '!'.ord.to_s(2)
<DeBot> vikaton: "100001"
<vikaton> That's a problemmm
<jhass> not really
havenwood has joined #crystal-lang
<jhass> >> (1 * 2**0 + 0 * 2**1 + 0 * 2**2 + 0 * 2**3 + 0 * 2**4 + 1 * 2**5).chr
<DeBot> jhass: Error in line 3: undefined method 'chr' for Float64
<jhass> >> (1 * 2**0 + 0 * 2**1 + 0 * 2**2 + 0 * 2**3 + 0 * 2**4 + 1 * 2**5).to_i.chr
<DeBot> jhass: '!'
<jhass> totally correct
Sadin has joined #crystal-lang
<vikaton> jhass: I know its correct, its a problem with my binary parsing
<vikaton> >> '?'.ord.to_s(2).length
<DeBot> vikaton: 6
<vikaton> >> 100001.chr
<DeBot> vikaton: '
<vikaton> >> 100001.to_s(2)
<DeBot> vikaton: "11000011010100001"
<vikaton> >> 0b100001.chr
<DeBot> vikaton: '!'
kostya has joined #crystal-lang
<vikaton> >> 0b00100001.chr
<DeBot> vikaton: '!'
<vikaton> o
<jhass> it's just leading zeros
<jhass> in decimal, 021 and 21 being the same thing doesn't confuse you ;)
<vikaton> Yeah, I need it to be length of 8 tho
<jhass> remember rjust?
<vikaton> yeah
<vikaton> >> '@'.ord.to_s(2).length
<DeBot> vikaton: 7
<vikaton> which chars have length of 6?
<vikaton> >> '$'.ord.to_s(2).length
<DeBot> vikaton: 6
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> >> '\n'.ord.to_s(2).size
<DeBot> jhass: 4
<vikaton> blegh
<jhass> >> '\a'.ord.to_s(2).size
<DeBot> jhass: 7
<jhass> >> '\b'.ord.to_s(2).size
<DeBot> jhass: 4
<jhass> >> '\0'.ord.to_s(2).size
<DeBot> jhass: 1
<jhass> >> '☃'.ord.to_s(2).size
<DeBot> jhass: 14
<unshadow> >> "\fa".to_s
<DeBot> unshadow: "\fa"
<unshadow> >> a = "testing"; a.match(/TESTING/i)
<DeBot> unshadow: #<MatchData "testing">
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
<unshadow> >> Time.now
<DeBot> unshadow: 2015-05-12 14:40:03
<unshadow> >> Date.today
<DeBot> unshadow: Error in line 3: undefined constant Date
<vikaton> jhass: :(
<vikaton> >> '$'.ord.to_s(2).rjust(8).length
<DeBot> vikaton: 8
<vikaton> >> '$'.ord.to_s(2).rjust(8)
<DeBot> vikaton: " 100100"
<jhass> check its docs again
Ven has joined #crystal-lang
<BlaXpirit> jhass, anything like sprintf?
<BlaXpirit> (is there)
<jhass> >> "%s" % ["yes"]
<DeBot> jhass: "yes"
<BlaXpirit> >> "%08b" % 62
<DeBot> BlaXpirit: "00111110"
<jhass> >> sprintf "%s", "too actually"
<DeBot> jhass: "too actually"
<BlaXpirit> vikaton,
<jhass> but I like String#% better myself
<BlaXpirit> >> "%08b" % '$'.ord
<DeBot> BlaXpirit: "00100100"
<BlaXpirit> I hate printf language
<jhass> >> "$".ord.to_s(2).rjust(8, '0')
<DeBot> jhass: Error in line 3: undefined method 'ord' for String
<jhass> meh
<jhass> >> "$".ord.to_s(2).rjust(8, "0")
<DeBot> jhass: Error in line 3: undefined method 'ord' for String
<jhass> oh, right
<jhass> >> '$'.ord.to_s(2).rjust(8, '0')
<DeBot> jhass: "00100100"
<BlaXpirit> >> "%08b" % '$'.ord
<DeBot> BlaXpirit: "00100100"
<jhass> yeah, just saying rjust can do it
<vikaton> whoah
<vikaton> >> printf "%s".23
<DeBot> vikaton: Syntax error in eval:3: expecting any of these tokens: IDENT, +, -, *, /, %, |, &, ^, **, <<, <, <=, ==, !=, =~, >>, >, >=, <=>, ||, &&, ===, [], []=, ! (not 'NUMBER')
<vikaton> >> printf "%s",23
<DeBot> vikaton: 23nil
<BlaXpirit> uhh don't mind the nil, it's just the return value
<BlaXpirit> jhass, suggestion: instead of just the return value, please output => before it
<unshadow> >> Time.new
<DeBot> unshadow: 2015-05-12 14:54:09
<unshadow> >> Time.now
<DeBot> unshadow: 2015-05-12 14:54:13
<unshadow> >> Time.now.to_i
<DeBot> unshadow: 1431442460
<unshadow> >> Time.now.to_s
<DeBot> unshadow: "2015-05-12 14:54:24"
<BlaXpirit> AND when there is output, append like 3 spaces then => then return value
<BlaXpirit> hmmm i'm really not liking this bot spam
<BlaXpirit> in any other channel there would be shouting already :p
<unshadow> >> Time.now.day
<DeBot> unshadow: 12
<jhass> and re spam, I'm more okayish here with it, since there's no repl and no online playbin
<jhass> though maybe we should refer people more to use pms
<unshadow> >> puts "BlaXpirit, there isn't IRB only jhass's bot :)"
<DeBot> unshadow: BlaXpirit, there isn't IRB only jhass's bot :)
<jhass> (which the bot responds to)
<BlaXpirit> I would recommend recommending people to only use this bot to show things. if you have no idea what you're writing, and it will take you many attempts to get it working, use private message to bot.
<jhass> I don't really have any more authority here than you do, so... ;)
<BlaXpirit> really doubt that
<jhass> check channel ACL, all that counts at the end of the day
unshadow has quit [Quit: leaving]
unshadow has joined #crystal-lang
<unshadow> Why is that ? --> [DeBot] >> a = [1,2,3]; a.each do |num| {puts num} end
<unshadow> >> a = [1,2,3]; a.each do |num| {puts num} end
<DeBot> unshadow: 1
bcardiff has joined #crystal-lang
<BlaXpirit> u get first string of the output
<BlaXpirit> >> a = [1,2,3]; a.each do |num| {printf num} end
<DeBot> BlaXpirit: in /usr/lib/crystal/char_reader.cr:140: undefined method 'unsafe_byte_at' for Int32
<BlaXpirit> oh ok.
<BlaXpirit> so it uses the actual printf D:
<BlaXpirit> >> a = [1,2,3]; a.each do |num| {printf "%d", num} end
<DeBot> BlaXpirit: 123[1, 2, 3]
<unshadow> oh, ok :)
<BlaXpirit> yeah, would like to see better output
<jhass> parsing crystals output is hard :P
<jhass> as said, PRs welcome
<BlaXpirit> i have an idea
<BlaXpirit> first one of them is to concatenate all lines
<BlaXpirit> what symbol do u like for that?
<BlaXpirit> line1 / line2 or line1 \\ line2
<jhass> not sure, maybe some fancy unicode one?
<BlaXpirit> right.
<BlaXpirit> ¶
<jhass> yeah, not sure how intuitive it is though
<jhass> also then we definitely need to truncate to ~60
<BlaXpirit> well isn't it truncated already?
<jhass> okay, maybe ~100 is okay too
<jhass> I don't remember :D
<BlaXpirit> i don't think any change is needed for truncation
<BlaXpirit> says limit=350
<jhass> ah yeah, I'm thinking about lowering it
<BlaXpirit> let's see how long it actually is
<jhass> IRC message limit is 510 bytes, that includes prefix and stuff
<BlaXpirit> >> "o"*200
<DeBot> BlaXpirit: "oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"
<BlaXpirit> i think this is good
<jhass> utf-8 char is up to 4 bytes
<jhass> >> "
<DeBot> jhass: "😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣😣ðŸ˜
<BlaXpirit> uhhuh
<jhass> I broke it \o/ :D
<jhass> >> "
<DeBot> jhass: "
<BlaXpirit> that emoticon though
<jhass> so maybe ~450 of space per message, /4 ~ 110, so 100 makes actually a more reasonable limit I guess
<BlaXpirit> it is not enough
<BlaXpirit> you call it reasonable only because of implementation details
<jhass> we have the eval bot in #ruby currently limited to 60
<BlaXpirit> D:
<jhass> oh, no, it's bumped up again to 100
<vikaton> Yeah rjust is amazing for this
<jhass> I guess we should built an online playpen finally and have the bot just use its API
<vikaton> ^ YES PL0X
<BlaXpirit> ↵
<jhass> yeah, I was thinking an arrow like that, I think I like it more
<jhass> though if we go the online playpen approach we could just keep first line and link
<BlaXpirit> links are even more obnoxious though :|
<jhass> not if they're short enough
<jhass> jeez, .al is expensive
<BlaXpirit> 1 ↵ 2 ↵ 3 ⇒ [1, 2, 3]
<BlaXpirit> i dunno
<BlaXpirit> of course, this probably means that it would have to be always prepended with those spaces
<BlaXpirit> because impossible to detect if there was any output yet
<jhass> well, could .lstrip before sinding off
<jhass> *sending
<BlaXpirit> sure
<BlaXpirit> another thing is, it would probably be 1 ↵ 2 ↵ 3 ↵ ⇒ [1, 2, 3]
<jhass> mh, yeah
<jhass> I'm favoring the online playpen API and link solution in the midterm tbh
<BlaXpirit> meh
<BlaXpirit> how about doing eval output to stderr
<jhass> meh, seems like a hack
<BlaXpirit> if you think about it, in a way it's even uhh,... semantically better
<jhass> it's not an error
<BlaXpirit> but it's also not output
<BlaXpirit> ok, in a way it is.....
<jhass> it's in the majority of cases the main output in fact
<jhass> using p, pp, puts, print explicitly is the rare case
<BlaXpirit> well, even irb > printf "a" gives "a=>nil"
Ven has quit [Ping timeout: 255 seconds]
<jhass> mh, can't come up with a nice short domain that's not overly expensive
<BlaXpirit> guys at #xonotic use http://nxs.re/
<jhass> .cr is like $160 a year, .al still like $60
<jhass> that strikes things like eval.cr, cryst.al cr.ev.al etc from my list
<jhass> donuts has codes, so that's about $35
<jhass> crystal.codes
<jhass> somebody regged that already, I see
<vikaton> :P
asterite has joined #crystal-lang
<asterite> jhass: if you (or anyone) writes a playpen, we can host it
<asterite> and put it in the crystal-lang domain
<vikaton> play.crystal.org
asterite has quit [Client Quit]
<vikaton> woops, one of my websites is not doing well
<jhass> Registrant Organization:Crystal Software Foundation oO
<strcmp1> jhass, do you speak more english than german?
<vikaton> jhass is German o.0
<strcmp1> i know :p
<jhass> for varying definitions of speak, I guess atm I do
<vikaton> I forgot the ?
<strcmp1> what are you going to do when you wake up, and you have forgotten your mother tongue?
<jhass> I do type more english than german currently
<vikaton> sitzkrieg
<jhass> I listen to a german podcast and it'll be back
<BlaXpirit> impossible
<BlaXpirit> to forget
<vikaton> impossible ?
<jhass> I have to admit sometimes I have an english expression for something more present than an equally good german one
<strcmp1> there's a lot of german rubyists
unshadow_ has joined #crystal-lang
unshadow has quit [Ping timeout: 246 seconds]
asterite has joined #crystal-lang
<asterite> The playpen doesn't have to be written in crystal, you could use rails or php
<asterite> Crystal is not the best language for writing web apps right now...
<jhass> well, I'd design it as an API and just write a statically build JS frontend for it
<BlaXpirit> modify rust playpen
<jhass> but how the sandboxing is done depends a lot on how you host it
<asterite> so you'll use a basic HTTP::Sever and check against the Request object?
<jhass> I guess, or perhaps frank
<asterite> Well, if we host it in our server zeus than we can do anything, I think
<vikaton> asterite: yes it is :P
<vikaton> Try Moonshine, it's what I use
<jhass> but however I'd like a short domain so I can shift DeBot's eval plugin to it ;P
<vikaton> De.bot
<strcmp1> play.crystal-lang.org
harisamin has joined #crystal-lang
<strcmp1> why not just use eval.in btw it supports multiple languages?
<BlaXpirit> short link to paste in IRC
<strcmp1> as a backend seems fine
<jhass> yeah, http://play.crystal-lang.org/abcef124 is way too long and I hate shorters if they can be avoided
<jhass> I run my own shorter and barely use it, I have 0 trust in them :P
<vikaton> play.rust-lang.org shortens the url
<asterite> Oh, so you'll be able to save code there?
<jhass> oh yeah, that's the plan too
<jhass> store input and output to postgres
<strcmp1> output?
<strcmp1> why?
<asterite> are there postgres bindings already?
<jhass> so you don't have to rerun it at each view?
<jhass> I've seem some repo at least
<strcmp1> you would probably want to
<jhass> no I wouldn't
<asterite> There's this: https://github.com/will/crystal-pg . In any case, it's always a good change to improve things ;-)
JBat has quit [*.net *.split]
DerisiveLogic has joined #crystal-lang
havenwood has quit []
asterite has quit [Quit: Page closed]
<jhass> kinda cheesy, but cr.direct seems available
<BlaXpirit> .......
<jhass> I said it's cheesy :P
<BlaXpirit> or how about you just get a hold of any meaningless short domain
<BlaXpirit> or just use any url shortener
<jhass> you're taking the fun out of it :(
<BlaXpirit> these urls wouldn't be for show. url would be play.crystal-
jeromegn has quit [Quit: jeromegn]
leafybasil has quit [Ping timeout: 240 seconds]
harisamin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vikaton has quit []
zz_Cidan is now known as Cidan
waterlink has joined #crystal-lang
havenwood has joined #crystal-lang
BlaXpirit has quit [Remote host closed the connection]
kostya has quit [Remote host closed the connection]
BlaXpirit has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 258 seconds]
harisamin has joined #crystal-lang
<crystal-gh> [crystal] ssvb opened pull request #655: Autodetect triple if the default triple is not compatible with the rotfs (master...20150512-triple-autodetect) http://git.io/vUVWk
bcardiff has quit [Quit: Leaving.]
shama has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
kulelu88 has joined #crystal-lang
bcardiff has joined #crystal-lang
Sadin has quit [Ping timeout: 255 seconds]
Cidan is now known as zz_Cidan
zz_Cidan is now known as Cidan
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
bcardiff has quit [Ping timeout: 246 seconds]
orliesaurus has quit [Excess Flood]
bcardiff has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 5 new commits to master: http://git.io/vUwZu
<crystal-gh> crystal/master 7882b1d Ary Borenszweig: Fixed a bug related to restrictions, modules and free vars
<crystal-gh> crystal/master 64b0dce Ary Borenszweig: Added Iterator#chain
<crystal-gh> crystal/master 0a0911f Ary Borenszweig: Fixed #654: wrong macro parsing
Guest86303 has joined #crystal-lang
bcardiff1 has joined #crystal-lang
bcardiff has quit [Read error: Connection reset by peer]
<travis-ci> manastech/crystal#2335 (master - 1a6003f : Ary Borenszweig): The build was fixed.
Guest86303 has quit [Quit: ZNC - http://znc.in]
<jhass> >> 123.to_s(36)
<DeBot> jhass: "3F"
<jhass> mmh
<jhass> >> 9223372036854775807.to_s(36)
<DeBot> jhass: "1Y2P0IJ32E8E7"
<jhass> >> "1Y2P0IJ32E8E7".to_i(36)
<DeBot> jhass: 2147483647
<jhass> >> "1Y2P0IJ32E8E7".to_i64(36)
<DeBot> jhass: Error in line 3: wrong number of arguments for 'String#to_i64' (1 for 0)
<jhass> heh
bcardiff1 has quit [Quit: Leaving.]
notfowl- has joined #crystal-lang
notfowl has quit [Excess Flood]
leafybasil has joined #crystal-lang
Sadin has joined #crystal-lang
willlll has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
<willlll> Why can’t you call a macro from a method? get this error: expanding macro in ./test.cr:24: for expression must be an array, hash or tuple literal, not Var:
<jhass> willlll: code?
<willlll> I'm exparimenting with trying to allow you get just single types out instead of the alias union type, so using them later on is eaiser
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vUwhp
<crystal-gh> crystal/master 60c700e Ary Borenszweig: Added real x86_64 abi spec
<jhass> willlll: macro def defines a runtime method, so query is a parameter of the method, you can't pass its value to a macro since the value is only known at runtime
<jhass> er, same for classes of course
<willlll> oh yeah, and also even if it’s not macro def on line 32, just def
<jhass> I guess you still tried to pass the parameter to the macro
<jhass> method and macro parameters are not interchangeable, since they're compile time vs runtime
<willlll> I did want to be able to return an array of tuples, but it looks like I might have to go down the json_mapper route and make you define a class or struct
<jhass> yeah
asterite has joined #crystal-lang
<willlll> thanks for the help
<jhass> or you go the Java approach and return a Row which has string(field), int(field) and so on
<willlll> i’ll look in that too
CraigBuchek has joined #crystal-lang
<asterite> willlll: going the json_mapping way is definitely "the Crystal way" (tm)
<asterite> because then you don't even need intermediate arrays
<asterite> but maybe for random queries where you just want a tuple it should still be possible... I'll try to make Tuple(Int32, String).from_json(%([1, "hello"])) work
<asterite> but it's hard because in Tuple(T), T is a tuple itself and the reflection for that is still very green
<asterite> Mmm... I mean, unfinished (not sure "very green" is an English expression that means something :-P)
<asterite> willlll: you can also check how it's done in crystal-sqlite3
<asterite> it doesn't have a macro like json_mapping, but processing data is simple
<asterite> the #[] method in ResultSet returns a union of all types, you have to use `as ...` to cast, but as jhass says, you could add #int, #string, etc. methods (like in Java)
<asterite> We should actually have a unified DB API, and macros for that
asterite has quit [Quit: Page closed]
<willlll> right now it’s array of array of union type, and you have to use as to cast afterwards
<willlll> but that surpised me, when I actually wanted to compare an int, and didn’t know I had to cast :)
<willlll> “very green” works in english. new, not tested, etc
asterite has joined #crystal-lang
orliesaurus has joined #crystal-lang
<asterite> willlll: ah, good :-)
<asterite> Also, as we program in crystal we find more patterns and ways to do things, so have fun experimenting :-)
<asterite> for example timecop.cr led to way to webmock.cr
<willlll> It has been great so far. A few of us here are pretty excited about crystal.
<travis-ci> manastech/crystal#2336 (master - 60c700e : Ary Borenszweig): The build passed.
asterite has quit [Quit: Page closed]
<willlll> I understand it’s very difficult given the type inference, but I really hope that there can be a repl for interacting with production apps. Having a console open has saved me during emergencies so many times while running heroku postgres
asterite has joined #crystal-lang
<asterite> willlll: yes, we want something like that too :-)
<willlll> yes, just adding a +1 :)
asterite has quit [Client Quit]
Sadin has quit [Quit: Leaving]