00:00
fowlduck has quit [Remote host closed the connection]
00:00
<
crystal-gh >
[crystal] technorama opened pull request #1443: Slice add == and bytesize methods. (master...f/slice_compare)
http://git.io/vZ02w
00:04
<
crystal-gh >
[crystal] will opened pull request #1444: add TypeCastError for runtime casting exceptions (master...casting-exception)
http://git.io/vZ0au
00:20
elia has quit [Quit: Computer has gone to sleep.]
00:22
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
00:34
dfockler has quit [Remote host closed the connection]
00:46
qard has joined #crystal-lang
00:48
waj_ is now known as waj
01:01
waj has quit [Remote host closed the connection]
01:08
havenwood has joined #crystal-lang
02:06
sadin has joined #crystal-lang
02:07
Netfeed has quit [Ping timeout: 240 seconds]
02:38
waj has joined #crystal-lang
02:45
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:53
ponga has quit [Quit: Connection closed for inactivity]
03:02
dylanmei has quit [Ping timeout: 256 seconds]
03:24
sadin has quit [Read error: Connection reset by peer]
03:31
lokulin has quit [Ping timeout: 246 seconds]
03:42
lokulin has joined #crystal-lang
03:43
waj has quit [Remote host closed the connection]
04:02
havenwood has joined #crystal-lang
04:32
waj has joined #crystal-lang
04:37
waj has quit [Ping timeout: 250 seconds]
05:38
waj_ has joined #crystal-lang
05:42
waj_ has quit [Ping timeout: 246 seconds]
05:57
ylluminate has joined #crystal-lang
05:59
BlaXpirit has joined #crystal-lang
06:00
ssvb has quit [Ping timeout: 244 seconds]
06:19
ylluminate has quit [Quit: Leaving.]
06:52
Netfeed has joined #crystal-lang
07:12
havenwood has quit [Ping timeout: 252 seconds]
07:18
Ven has joined #crystal-lang
07:26
waj_ has joined #crystal-lang
07:30
ylluminate has joined #crystal-lang
07:31
waj_ has quit [Ping timeout: 244 seconds]
07:38
Ven has quit [Ping timeout: 240 seconds]
07:50
elia has joined #crystal-lang
07:50
ylluminate has quit [Quit: Leaving.]
08:02
BlaXpirit has quit [Quit: Konversation]
08:04
kyrylo has joined #crystal-lang
08:12
sardaukar has quit [Ping timeout: 256 seconds]
08:16
waj_ has joined #crystal-lang
08:37
leafybasil has quit [Remote host closed the connection]
08:38
waj_ has quit [Remote host closed the connection]
08:47
sardaukar has joined #crystal-lang
08:54
sardaukar has quit [Ping timeout: 256 seconds]
08:57
leafybasil has joined #crystal-lang
09:10
ylluminate has joined #crystal-lang
09:16
ylluminate has quit [Ping timeout: 244 seconds]
09:16
ylluminate has joined #crystal-lang
09:39
waj_ has joined #crystal-lang
09:42
sardaukar has joined #crystal-lang
09:42
ssvb has joined #crystal-lang
09:43
waj_ has quit [Ping timeout: 250 seconds]
09:47
sardaukar has quit [Ping timeout: 256 seconds]
09:55
sardaukar has joined #crystal-lang
10:00
sardaukar has quit [Ping timeout: 256 seconds]
10:01
sardaukar has joined #crystal-lang
10:17
<
crystal-gh >
crystal/master 0f3ea04 Technorama Ltd: Slice add == and bytesize methods.
10:17
<
crystal-gh >
crystal/master 7e91ea7 Jonne Haß: Merge pull request #1443 from technorama/f/slice_compare...
10:33
ponga has joined #crystal-lang
10:50
Ven has joined #crystal-lang
10:50
sardaukar_ has joined #crystal-lang
10:50
sardaukar has quit [Read error: Connection reset by peer]
10:58
BlaXpirit has joined #crystal-lang
11:04
sardaukar_ has quit [Ping timeout: 256 seconds]
11:10
waj has joined #crystal-lang
11:14
waj has quit [Ping timeout: 268 seconds]
11:30
kyrylo has quit [Ping timeout: 246 seconds]
11:31
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:47
ylluminate has quit [Ping timeout: 260 seconds]
11:48
ssvb has quit [Ping timeout: 268 seconds]
12:08
<
dzv >
is there any way to inspect a method? specifically to see where it was defined?
12:11
waj has joined #crystal-lang
12:11
elia has quit [Quit: (IRC Client: textualapp.com)]
12:15
waj has quit [Ping timeout: 260 seconds]
12:38
<
nakilon >
dudes, I've subscribed to crystal issues on github, but was far from pc last days
12:39
<
nakilon >
[].min/max returns nil in Ruby
12:39
<
nakilon >
not min?/max?
12:39
<
jhass >
nakilon: yes, but that's a pain to work with in Crystal
12:39
<
jhass >
same reason we have [] raise and []? return nil
12:39
<
nakilon >
I don't get it (
12:40
<
nakilon >
where is the pain?
12:40
<
jhass >
nakilon: empty_or_not.min + 1 -> undefined method + for nil (compile time type Int32?)
12:40
<
nakilon >
[1,2,3][100] always was nice thing for me in Ruby, opposite to Python for example
12:41
<
nakilon >
but how having 'empty_or_not.min? + 1' saves us?
12:41
<
nakilon >
would be the same
12:41
<
jhass >
we have both now
12:42
<
jhass >
i_am_sure_this_is_not_empty.min + 1 # ok, may raise if I was wrong
12:42
<
jhass >
(empty_or_not.min? || 0) + 1 # ok, compiler forced us to handle the empty case
12:42
<
nakilon >
so it's just a shortcut to kinda assert?
12:43
<
nakilon >
would be nice thing to have -- a docs page "Common gotchas when moving to Crystal from Ruby"
12:44
<
nakilon >
with such things as this one
12:44
<
nakilon >
otherwise newcomers like me will not know what exactly they are doing ..D having '?' needed to mimic Ruby in those methods is unexpected
12:45
elia has joined #crystal-lang
12:47
<
jhass >
?from_ruby=https://github.com/manastech/crystal/wiki/Crystal-for-Rubyists
12:47
<
DeBot >
jhass: Set from_ruby.
12:48
<
jhass >
feel free to add any ;)
13:00
<
dzv >
is there a way to check if something is a noncontainer value? is_a?(Int|Bool|Float|Nil|...) and not_a?(Tuple|StaticArray|Slice|...)
13:05
<
nakilon >
in Ruby you do.responds_to(:each) for this
13:21
kyrylo has joined #crystal-lang
13:23
elia has quit [Read error: Connection reset by peer]
13:23
elia_ has joined #crystal-lang
13:23
wuehlmaus has quit [Quit: Lost terminal]
13:27
dylanmei has joined #crystal-lang
13:41
emancu has joined #crystal-lang
13:43
NeverDie has joined #crystal-lang
13:45
havenwood has joined #crystal-lang
13:50
benoist has joined #crystal-lang
13:52
benoist has quit [Client Quit]
14:05
ssvb has joined #crystal-lang
14:14
tomchapin has joined #crystal-lang
14:32
waj has joined #crystal-lang
14:35
waj has quit [Remote host closed the connection]
14:35
waj has joined #crystal-lang
14:47
caryanne has joined #crystal-lang
14:53
<
BlaXpirit >
>> Array(Int32).is_a? Enumerable
14:57
dfockler has joined #crystal-lang
15:07
luislavena has joined #crystal-lang
15:12
<
waj >
>> Array(Int32).new.is_a? Enumerable
15:22
apt-get has joined #crystal-lang
15:25
<
thor77 >
>> [1].contain 1
15:25
<
thor77 >
>> [1].contains 1
15:26
<
thor77 >
whats the right method to check if an array contains an specific element?
15:28
<
thor77 >
>> [1].includes 1
15:28
<
DeBot >
thor77: Error in line 4: undefined method 'includes' for Array(Int32) (did you mean 'includes?'?) -
http://carc.in/#/r/eyb
15:28
<
thor77 >
>> [1].includes? 1
15:29
* thor77
is writing to less crystal...
15:37
dylanmei has quit [Quit: ZZZzzz…]
15:39
<
jhass >
waj: will the new debug stuff work with 3.7 too?
15:43
dylanmei has joined #crystal-lang
15:48
dylanmei has quit [Quit: ZZZzzz…]
15:50
<
waj >
jhass: it probably need some changes because the DIBuilder api changed again
15:52
<
jhass >
did you actually test it against 3.6 btw?
15:52
<
waj >
yes, I'm using 3.6 in my machine
15:53
<
waj >
maybe we should change the omnibus to use 3.6 too
15:54
waj has quit [Remote host closed the connection]
16:06
ylluminate has joined #crystal-lang
16:10
waj has joined #crystal-lang
16:12
<
waj >
did you also specify --single-module ?
16:12
* nakilon
is making his very first fix+improve pullrequest in Array
16:12
<
jhass >
ah, right that I forgot
16:12
<
jhass >
maybe we should imply the flag with -d for now?
16:12
<
waj >
mmm... no, I need to fix it :)
16:13
<
willl >
speaking of -d, I was thinking the other day that maybe all non-release builds should assume -d
16:13
<
waj >
yup, that's reasonable
16:14
<
waj >
also because it'll enable to get better backtraces with line numbers and everything
16:15
dylanmei has joined #crystal-lang
16:27
<
jhass >
mmh, either I'm too dumb to use lldb or it's not working for me
16:27
<
jhass >
should having "debugger" in the code and then running it through lldb drop back into the prompt if it's reached?
16:33
tomchapin has quit [Read error: Connection reset by peer]
16:33
tomchapi_ has joined #crystal-lang
16:33
<
asterite >
willl: what's your opinion of go's cgo?
16:35
<
nakilon >
jhass, I'm editing Array specs, pls tell me: if this [1, 2, 3][4, 0] is supposed to raise an error, why this [1, 2, 3][3 .. 1] isn't?
16:35
<
waj >
jhass: yes... what's happening instead?
16:35
<
jhass >
waj: it just hangs
16:35
elia_ has quit [Quit: Computer has gone to sleep.]
16:36
<
nakilon >
maybe it was a typo and really had to be [1, 2, 3][3 .. 1] ?
16:36
<
nakilon >
i mean [1, 2, 3, 4, 5, 6][3 .. 1]
16:37
<
jhass >
nakilon: because (3..1).to_a == []
16:38
<
jhass >
waj: and if I hit Ctrl+C then it drops into pthread_cond_wait
16:39
<
jhass >
well, exits at
16:39
<
waj >
can you share some code?
16:39
dylanmei has quit [Read error: Connection reset by peer]
16:40
<
nakilon >
jhass, but $ crystal eval "p [1,2,3,4,5][2..-2]"
16:40
<
jhass >
waj: I just did puts "hi"; debugger; puts "ho"; (on three lines)
16:40
<
nakilon >
and it is also .to_a = []
16:40
dylanmei has joined #crystal-lang
16:41
<
nakilon >
I suppose he point was to mimic Ruby but with raising on indexex exceeding -length...length
16:41
<
nakilon >
then [1, 2, 3][3 .. 1] would have to raise too
16:41
<
jhass >
well it returns [] in Ruby too
16:41
<
nakilon >
*the point
16:42
<
nakilon >
in RUby [1, 2, 3][4, 0] doesn't raise
16:42
<
jhass >
but returns nil
16:42
<
nakilon >
accodring to current specs, Crystal does
16:42
<
jhass >
and usually where Ruby returns nil we raise
16:43
apt-get has quit [Ping timeout: 268 seconds]
16:43
<
jhass >
Ruby returns nil in that case, so we raise
16:43
<
nakilon >
wrong line number
16:44
<
jhass >
that matches Ruby's behavior
16:44
<
nakilon >
and shouldn't, right?
16:44
<
jhass >
well, so far it should I think
16:45
<
jhass >
as said I think the rule so far is where Ruby returns nil we raise, [] != nil
16:45
<
nakilon >
also I'll have to think why sometimes it's ArgumentError instead of IndexError
16:45
<
jhass >
that probably should be unified
16:45
<
nakilon >
oh, sry, misread you
16:46
shama has joined #crystal-lang
16:47
luislavena has quit [Remote host closed the connection]
16:47
apt-get has joined #crystal-lang
16:53
<
nakilon >
oh, ArgumentError is when we you count instead of range
16:54
<
jhass >
mmh, can make sense I guess ;)
16:54
qard has joined #crystal-lang
16:55
apt-get has quit [Ping timeout: 268 seconds]
17:00
apt-get has joined #crystal-lang
17:09
<
nakilon >
this blows my mind
17:09
<
nakilon >
$ ruby -e "p [1, 2, 3][5 .. 4]" => nil
17:09
<
nakilon >
$ ruby -e "p [1, 2, 3][3 .. 1]" => []
17:09
<
nakilon >
i guess the reaon is because of BOTH ends are out of range
17:10
<
nakilon >
weird, that it's so comlicated
17:11
NeverDie has joined #crystal-lang
17:13
<
nakilon >
not even just "out" but "out more than by one": $ ruby -e "p [1, 2, 3][4 .. 1]" => nil
17:15
leafybasil has quit [Remote host closed the connection]
17:15
leafybasil has joined #crystal-lang
17:19
<
waj >
jhass: did you try with gdb?
17:19
<
jhass >
mmh, no, not yet
17:19
<
jhass >
interesting, seems to work
17:20
luislavena has joined #crystal-lang
17:20
leafybasil has quit [Ping timeout: 246 seconds]
17:30
tomchapin has joined #crystal-lang
17:33
tomchapin has quit [Read error: No route to host]
17:33
ylluminate has quit [Quit: Leaving.]
17:33
<
waj >
yes, I need to ask asterite about that
17:33
tomchapin has joined #crystal-lang
17:35
tomchapin has quit [Read error: No route to host]
17:35
<
jhass >
I wonder why lldb hangs for me though
17:37
NeverDie_ has joined #crystal-lang
17:37
tomchapin has joined #crystal-lang
17:38
ylluminate has joined #crystal-lang
17:40
<
waj >
I just tested in Linux and it hangs as well
17:40
<
waj >
however... when you do Ctrl+C it stops but in a different thread
17:40
<
waj >
and the main thread seems to be stopped just where it should
17:40
NeverDie has quit [Ping timeout: 246 seconds]
17:44
ylluminate has quit [Quit: Leaving.]
17:48
leafybasil has joined #crystal-lang
17:48
elia has joined #crystal-lang
17:49
ylluminate has joined #crystal-lang
17:52
<
jhass >
but you can't resume it
17:52
<
jhass >
it still hangs
17:53
NeverDie_ is now known as Neverdie
17:59
<
asterite >
nakilon: [1, 2, 3][4 .. 1] also gives nil
17:59
<
nakilon >
this method and the next has the same arguments -- doesn't the second one override the first one?
17:59
<
asterite >
It gives nil if any of the ends are out of bounds
18:08
<
nakilon >
oh, I guess Crystal sees, that this method accepts block
18:17
<
jhass >
yup, taking a block or not counts into the method signature
18:18
elia has quit [Quit: Computer has gone to sleep.]
18:19
elia has joined #crystal-lang
18:23
elia_ has joined #crystal-lang
18:24
elia has quit [Ping timeout: 246 seconds]
18:24
elia_ has quit [Client Quit]
18:33
ylluminate has quit [Quit: Leaving.]
18:36
konsolebox has joined #crystal-lang
18:38
ylluminate has joined #crystal-lang
18:39
<
konsolebox >
hi i'm new to Crystal. do && and || follow the same precedence as in Ruby? i.e. && is higher than ||.
18:41
<
jhass >
that's a good question I never checked
18:42
<
jhass >
>> true && false || true && false
18:42
<
jhass >
wait, that doesn't prove anything
18:44
dfockler has quit [Remote host closed the connection]
18:45
<
konsolebox >
>> true || false && false
18:45
<
konsolebox >
seems like it
18:45
<
konsolebox >
>> true or false and false
18:45
<
konsolebox >
too bad
18:45
<
konsolebox >
we need that
18:45
<
jhass >
we don't :P
18:45
<
konsolebox >
s/we/i/
18:46
<
konsolebox >
because i hate the confusion when the logic chain gets long.. we rely too much on ()
18:46
<
crystal-gh >
crystal/master 7af12a8 Ary Borenszweig: Fixed Cast#to_s
18:46
<
crystal-gh >
crystal/master ee90784 Ary Borenszweig: Codegen: add missing `request_value` for Cast node. Related to #1444
18:46
<
crystal-gh >
crystal/master 430de21 Ary Borenszweig: Some fixes to wrong locations
18:46
<
asterite >
jhass: fixed the wrong location :)
18:46
<
asterite >
If you find more, let me know
18:46
<
jhass >
asterite: <3
18:53
<
asterite >
It's easier if you introduce a compile error at the line that has incorrect location, and the error message should point to an incorrect place
18:54
<
asterite >
Oh, but it's on the end
18:55
<
jhass >
seems to be the pointerof location is one off, no?
18:55
<
jhass >
given it hits the def cstr correctly
18:55
<
asterite >
Ah, I think pointerof doesn't have an instruction, I don't know. waj knows about this :)
18:56
<
asterite >
I think after a def you get to step on the "end", so maybe "pointerof" is being skipped
18:56
kyrylo has quit [Ping timeout: 240 seconds]
18:57
<
jhass >
yeah okay, same for plain @var access I guess
18:57
<
jhass >
mmh, maybe not, now I landed twice on the same end
18:59
<
jhass >
dunno, something's odd there
19:00
<
jhass >
that second end should've been the 2423 io.write Slice.new(cstr, bytesize) from def to_s(io) again IMO
19:01
<
jhass >
or directly the initialize from Slice.new
19:02
<
jhass >
but it's getting usable, now variable introspection and it's actually useful :P
19:06
dfockler has joined #crystal-lang
19:07
pdurbin has left #crystal-lang ["WeeChat 0.4.3"]
19:16
Neverdie has joined #crystal-lang
19:17
fowlduck has joined #crystal-lang
19:23
tomchapin has joined #crystal-lang
19:24
<
waj >
jhass: quite delayed answer -> only assignments and calls have debug metadata right now, that's why many statements are skipped
19:25
<
jhass >
still weird that I ended up on the same end twice in a row
19:26
qard_ has joined #crystal-lang
19:26
Neverdie has joined #crystal-lang
19:26
qard has quit [Read error: Connection reset by peer]
19:27
fowlduck has quit [Remote host closed the connection]
19:32
<
jhass >
your globals look like constants
19:34
apt-get has quit [Ping timeout: 240 seconds]
19:39
<
nakilon >
how do I make a pull-request? fork, commit, push to master, create pull-request in web interface?
19:39
<
nakilon >
sry for noob question, never used Github
19:39
<
BlaXpirit >
nakilon, u just open a file u want to edit and edit it
19:39
<
jhass >
nakilon: basically, create a branch if you plan future/concurrent contributions
19:39
<
BlaXpirit >
i dont think it can be done if you want to change multiple files
19:40
<
nakilon >
jhass, too late, pushed to master ) is it too bad?
19:41
<
nakilon >
I don't get, when the main repo commits are pulling into my fork?
19:41
<
nakilon >
fresh ones
19:41
<
BlaXpirit >
nakilon, uh never
19:41
<
BlaXpirit >
you need to maintain that
19:41
<
jhass >
it's fine, at the end of the day you can always create a new branch if needed from the upstream master
19:42
Neverdie has joined #crystal-lang
19:42
<
BlaXpirit >
how i do it: just clone main repo and add remote "fork"
19:42
fowlduck has joined #crystal-lang
19:42
<
BlaXpirit >
this ensures easy pulls to keep up to date
19:43
<
jhass >
if you want to move it: git branch -m master my_feature_branch; git push origin my_feature_branch; git remote add upstream
https://github.com/manastech/crystal.git ; git fetch upstream git checkout -b master upstream/master; git push -f origin master
19:43
Neverdie has quit [Client Quit]
19:49
apt-get has joined #crystal-lang
19:49
kyrylo has joined #crystal-lang
19:50
apt-get has quit [Client Quit]
19:50
apt-get has joined #crystal-lang
20:06
Neverdie has joined #crystal-lang
20:32
dfockler has quit [Remote host closed the connection]
20:32
havenwood has joined #crystal-lang
20:34
dfockler has joined #crystal-lang
20:37
<
crystal-gh >
[crystal] Nakilon opened pull request #1450: Fixed Array[](start : Int, count : Int) (master...fixed_slice)
http://git.io/vZ2FK
20:38
<
nakilon >
damn git -- somehow commits got duplicated, lol
20:38
<
nakilon >
probably I can squash them
20:39
<
jhass >
nakilon: yeah, try git checkout fixed_slice; git rebase -i upstream/master;
21:17
BlaXpirit has quit [Quit: Konversation]
21:22
konsolebox has quit [Quit: Leaving]
21:29
luislavena has quit []
21:30
kulelu88 has joined #crystal-lang
21:32
Neverdie has joined #crystal-lang
21:36
leafybasil has quit [Remote host closed the connection]
21:38
dylanmei has quit [Ping timeout: 265 seconds]
21:40
dylanmei has joined #crystal-lang
21:49
Neverdie has quit [Read error: Connection reset by peer]
21:49
Neverdie has joined #crystal-lang
21:57
leafybasil has joined #crystal-lang
21:57
apt-get has quit [Ping timeout: 252 seconds]
22:15
havenwood has quit [Ping timeout: 244 seconds]
22:31
Neverdie has joined #crystal-lang
22:39
dylanmei has quit [Quit: ZZZzzz…]
22:41
waj has quit [Remote host closed the connection]
22:49
dfockler has quit [Remote host closed the connection]
22:55
waj has joined #crystal-lang
23:03
emmanueloga has quit [Ping timeout: 252 seconds]
23:04
grindhold has quit [Read error: Connection reset by peer]
23:04
[spoiler] has quit [Ping timeout: 252 seconds]
23:05
[spoiler] has joined #crystal-lang
23:05
grindhold has joined #crystal-lang
23:09
emmanueloga has joined #crystal-lang
23:19
waj has quit [Remote host closed the connection]
23:23
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:49
DJZ has joined #crystal-lang
23:54
<
DJZ >
anyone here?\
23:54
<
DJZ >
really really dumb question
23:54
<
DJZ >
how do i compile on windows
23:55
Neverdie has joined #crystal-lang
23:58
<
dzv >
not possible currently
23:58
<
DJZ >
alright, thanks anyway
23:58
<
dzv >
there is a porting efforts on github somewhere
23:58
<
DJZ >
gonna probably set up a vm then