tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dzv>
what do you want in npm that shards doesn't provide?
<CompanionCube>
actually, nvm
<CompanionCube>
it's just that the error messages leave much to be desired
<CompanionCube>
brb
tomchapin has joined #crystal-lang
havenwood has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NeverDie has joined #crystal-lang
<crystal-gh>
[crystal] rmosolgo opened pull request #1631: docs(String) add some documentation for String (master...string-docs) http://git.io/vcmTf
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh>
[crystal] rmosolgo opened pull request #1632: refactor(String#split) use the string implementation, even for Chars (master...refactor-string-split) http://git.io/vcmLR
Philpax has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 264 seconds]
qard has joined #crystal-lang
rmosolgo has joined #crystal-lang
qard has quit [Client Quit]
rmosolgo has quit [Remote host closed the connection]
willl has quit [Quit: Connection closed for inactivity]
rmosolgo has joined #crystal-lang
havenwood has joined #crystal-lang
Earnestly has joined #crystal-lang
<Earnestly>
Hi, where might I report issues against the documentation?
<Earnestly>
Would it be acceptable to create them against the main language repo?
<Earnestly>
This appears to be what others have done
rmosolgo has quit [Remote host closed the connection]
<asterite>
Earnestly: sure, they'll be very welcome
<jhass>
and that was my guess as to type restrict a global, so no
<Philpax>
yeah, I've already tested a few things
<Philpax>
I'm trying to implement a function that ends with a NoReturn callback
<Philpax>
i.e. once this function gets called, there's no going back
<Philpax>
the problem I'm running into is that the callback gets typed as Nil | String -> NoReturn
<jhass>
I think we got a @[Raises] flag, though that might only apply to C functions, never checked
<jhass>
mmh, actually why is it being typed as NoReturn an issue?
<jhass>
it doesn't fit -> Void or something?
<jhass>
it actually should fit any return type I think
<Philpax>
it gets typed as Nil, which propagates above and results in things like `def fn() if some_cond panic() else 5 end end` being typed as `Nil | Int32`
<Philpax>
might just have to write a shim in C
<jhass>
huh
<jhass>
raise should propagate, sounds like a bug
<Philpax>
it does propagate, but I'm not using raise
<Philpax>
I'm trying to reimplement raise's functionality without using raise (because it relies on things I can't use)
<jhass>
maybe @[Raises] is indeed what you need then
<jhass>
note raise is not a primitive or special cased in the compiler
<jhass>
(as far as I can tell)
<Philpax>
yeah, I've already looked through it
<Philpax>
it works because __crystal_raise is typed as NoReturn, which is possible because the last function it calls is a C function typed as NoReturn
<Philpax>
so I think I've solved my particular issue by doing the same thing
<Philpax>
i.e. calling a C function that's guaranteed to not return
<jokke>
Papierkorb: sup. have you thought it over?
pawnbox has joined #crystal-lang
<Philpax>
jhass: also came up with a solution for my typed global callback issue, I just came up with an initializer that calls the NoReturn C function
<Philpax>
still an unwieldy solution, I might add an issue regarding typed global variables
<jhass>
they're typed :P
<Philpax>
type-specified, not type-deducted :P
<Philpax>
sue me
<jhass>
I'd call them type restricted or somesuch
<jokke>
jhass: can you add a bot method for checking the time in buenos aires? ;)
<jhass>
:D
<jokke>
hehe
<jhass>
well, if Crystal had timezone support...
<jokke>
haha :D
<jokke>
i was about to poke asterite about something but noticed that it's 7:20 AM there
<jhass>
you can check his away status to see whether he's connected or not
<jokke>
yeah
<jokke>
jhass: you didn't care about websocket, right? :/
<jhass>
right :P
<jokke>
:P
pawnbox has quit [Remote host closed the connection]
<crystal-gh>
[crystal] jreinert opened pull request #1638: add reject method for ArrayLiterals in macros (master...reject-in-macro) http://git.io/vcYjU
<jokke>
jhass: is this ^ something you can merge if travis passes?
<jhass>
it has the sideeffect of {} being attracted to methods where you care about their return value and do/end being attracted to methods where you don't
<jhass>
and chaining on end or wrapping do/end into () looks just silly ;P
<jokke>
_that_ is true
<jokke>
list.each do |item| puts item end looks silly too though
<jokke>
for me at least
<jhass>
yes, I stretch it for single line stuff
<jhass>
but most of the time I just give the side effect stuff its 3 lines then
<jhass>
tap is probably the major exception
<jhass>
which I then reason with caring about the methods return value
<jhass>
but either way, following a rule dogmatically is wrong anyway IMO
<jokke>
yeah
<jokke>
if you agree with the changes, feel free to merge :)
<jokke>
ah
<jokke>
no
<jokke>
no i know what you mean
<jokke>
in ArrayLiteral.new
<jokke>
i should use {}
<jhass>
mmh, could you also add docs in docs/macros.cr?
<jokke>
ah sure
<jhass>
well, the surrounding code doesn't, I wouldn't require it at all
<jhass>
it's just my preference after all
trapped has joined #crystal-lang
<jhass>
mmh, that line in filter feels too smart
<jhass>
keep = true, keep if interpreter.accept(block.body).truthy? ?
<benner>
BlaXpirit, jhass: sure, but what object to create if I want to write into it? i.e. read(df, buff, size). "buffer :: UInt8[32]"?
<jhass>
Slice(UInt8).new(32) most of the time
ingsoc has joined #crystal-lang
<unshadow>
quit
unshadow has quit [Quit: leaving]
jhass is now known as not_jhass
<crystal-gh>
[crystal] jreinert opened pull request #1639: add copy overload to IO to copy at most *limit* bytes (master...copy-with-limit) http://git.io/vcO6e
not_jhass is now known as jhass
ingsoc has quit [Quit: Leaving.]
Ven has joined #crystal-lang
<Papierkorb>
jokke: can I query?
<jokke>
Papierkorb: sure!
greenarrow has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
trapped has quit [Read error: Connection reset by peer]
BlaXpirit has quit [Quit: Konversation]
trapped has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
havenwood has joined #crystal-lang
glenab has joined #crystal-lang
rmosolgo has joined #crystal-lang
<crystal-gh>
[crystal] rmosolgo closed pull request #1632: refactor(String#split) use the string implementation, even for Chars (master...refactor-string-split) http://git.io/vcmLR
<jokke>
oh! i found a bug in IO.copy
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vc3RG
<crystal-gh>
crystal/master 16baf5d Ary Borenszweig: Link to "documenting code" in Contributing.md
<crystal-gh>
[crystal] asterite closed pull request #1634: Move LL dump to post-optimisation for cross compilation (master...move-ll-dump) http://git.io/vcmWM
<asterite>
Oh, cool. I think waj would like that. However, we aren't that sure about master/develop, at least at work we use master as develop and then we have tags for each release
<jhass>
yeah, that's fine for crystal, develop isn't really needed here
<jhass>
we do it at diaspora since we install from the git repo
<jhass>
I'm rather pointing to the workflow stuff, explaining rebasing etc.
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<asterite>
jhass: I don't know, I have to think of a way to traverse the type hierarchy and check for implemented abstract defs in an efficient way, but it shouldn't be that hard. I still don't know how restrictions are considered
<jhass>
jokke: ^
<asterite>
For example, imagine you have `abstract def foo(x : Number)` and then you provide implementations for all number types
<asterite>
In any case, it's a duplicate
<asterite>
so we have to think about it a bit more
<jokke>
asterite: yeah
<jokke>
imho you shouldn't be able to reduce the types
<jokke>
the arg types
<jokke>
only the return types
<crystal-gh>
[crystal] adlerhsieh opened pull request #1645: Organize README for documenting_code (gh-pages...gh-pages) http://git.io/vc3pO
<asterite>
so the arg types must match exactly, right?
<jokke>
well
<asterite>
For example ByteFormat will have to change to list all overloads. I wouldn't mind doing that. Or maybe we can just remove the abstract def in those cases
Ven has joined #crystal-lang
<jokke>
i think it should be able to satisfy `abstract def foo(x : Int)` with `def foo(x : Number)` for example but not with `def foo(x : Int32)`
<jokke>
s/it/one/
<jokke>
and the other way around with return types
Philpax_ has joined #crystal-lang
<jokke>
so for `abstract def foo : Int` it should be okay to implement `def foo : Int32` but not `def foo : Number`
<jokke>
i have to pause for a minute to think about what i just said
glenab has quit [Remote host closed the connection]
<asterite>
Right now there's a bit of juggling to implement named arguments and splats, and I believe adding full support for it will require more juggling
<asterite>
I'll also have to check with waj
<asterite>
It becomes harder if you consider dispatch. Imagine you have foo.bar(x: 1, y: 2) and then two `bar` methods with `def bar(x, y)` and `def bar(y, x)`. It should work, but the order is different in every dispatch
<asterite>
Right now there's obviously the same issue, but I'll need to update the code to consider all possibilities. And also to give error if all required arguments are not specified, etc.
<crystal-gh>
[crystal] asterite pushed 3 new commits to master: http://git.io/vcsmq
<crystal-gh>
crystal/master 8738ecc Ary Borenszweig: Use `rm -rf` instead of `Dir.rmdir` in `init_spec`
<crystal-gh>
crystal/master ef023e0 Ary Borenszweig: Require space before argument name and type restriction. Fixes #1640
<crystal-gh>
crystal/master 6501a54 Ary Borenszweig: Moved the benchmark warning to the `bm` and `ips` methods, so it's not printed when specs are run. Related to #1596
havenwood has joined #crystal-lang
<travis-ci>
manastech/crystal#6501a54 (master - Moved the benchmark warning to the `bm` and `ips` methods, so it's not printed when specs are run. Related to #1596): The build passed. https://travis-ci.org/manastech/crystal/builds/82783689
Tuxified has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Tuxified has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
glenab has joined #crystal-lang
fowlduck_ has quit [Remote host closed the connection]
<asterite>
(Right now it works OK, we do a trick that is to create intermediate defs that reorder the args. We can do the same tricks, but it's a bit trickier, I think)
Philpax_ has quit [Read error: Connection reset by peer]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vcsl4