<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
<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
<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:
<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.
<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 :-)