jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.17.4 | 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
vikaton has quit [Quit: Connection closed for inactivity]
soveran has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
soveran has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
ozra_ has quit [Ping timeout: 250 seconds]
snsei has joined #crystal-lang
bjhaid has joined #crystal-lang
bjhaid has quit [Ping timeout: 250 seconds]
snsei has quit [Remote host closed the connection]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
icezimm has quit [Quit: Leaving.]
Raimondii has joined #crystal-lang
sebasr has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
sebasr has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 246 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
jroh has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
vikaton has joined #crystal-lang
snsei has quit [Remote host closed the connection]
buggs2 has joined #crystal-lang
buggs1 has quit [Ping timeout: 258 seconds]
<vikaton> how is crystal lang windows support coming along?
<txdv> a long
<vikaton> hm
<txdv> two 1 year old commits
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
Philpax has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
<jhass> nobody is actively working on it as far as I'm aware
<Davy_CC> llvm need to upgrades for supporting windows' error handling T_T
<jhass> LLVM needs to update. Period, no further reasoning necessary ;)
bjz has joined #crystal-lang
snsei has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snsei has quit [Ping timeout: 246 seconds]
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
trapped has joined #crystal-lang
pawnbox has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mark_66 has joined #crystal-lang
pawnbox has joined #crystal-lang
dom96 has quit [Changing host]
dom96 has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 5 new commits to master: https://git.io/vok5F
<crystal-gh> crystal/master b04b467 Julien Portalier: Socket.ip?(str) to validate IPv4 and IPv6 addresses
<crystal-gh> crystal/master f050e96 Julien Portalier: Legacy hostname validation for OpenSSL < 1.0.2
<crystal-gh> crystal/master 0090da1 Julien Portalier: OpenSSL: basic X509 certificate support
bjz has quit [Ping timeout: 276 seconds]
crack08 has joined #crystal-lang
bjz has joined #crystal-lang
<travis-ci> crystal-lang/crystal#c9f397e (master - Add spec to HostnameValidation for fe80:0::1 vs fe80::0:1): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135812218
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
ruslux has joined #crystal-lang
ruslux has quit [Ping timeout: 250 seconds]
TheLemonMan has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia1 has left #crystal-lang [#crystal-lang]
pawnbox has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
snsei has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 244 seconds]
get_drunk has joined #crystal-lang
sfcgeorge has joined #crystal-lang
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voIuE
<crystal-gh> crystal/master 4e8aa74 Ary Borenszweig: Merge pull request #2761 from crystal-lang/feature/class_vars...
snsei has joined #crystal-lang
<get_drunk> asterite: a long time ago, there was a discussion I think on one of the crystal blog posts about elixir
<get_drunk> and it was basically that you thought that FP wasn't a great approach in elixir compared to how easy it is to make things with OOP style, and that elixir has a better system already in place for macros
<asterite> Mmm... I think I just said that doing List.foo(list) and Enum.foo(enum) instead of just list.foo and enum.foo seems a bit verbose to me :)
<get_drunk> but crystal is eventually going to get better macros, and like generics and things like that, right? would that be better than elixir?
<get_drunk> well and the guy replied that you can do |> List.whatever
<get_drunk> which is true in elixir and like f# for example
<get_drunk> but that sort of expressivity is certainly possible in crystal in the future
<get_drunk> crystal macros seem to already work with the ast directly, is that so different from how elixir works?
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
kfpratt has joined #crystal-lang
steenuil has joined #crystal-lang
<jhass> elixir runs on the erlang VM, it's not a compiled language. Which makes putting it on a single "better/worse" scale with Crystal fairly pointless IMO
<jhass> generally calling languages better or worse than each other is in fact
snsei has quit [Remote host closed the connection]
<get_drunk> I mean the macros specifically
<get_drunk> which is what I said
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
get_drunk has quit [Ping timeout: 250 seconds]
sfcgeorge is now known as sfcg[away]
<asterite> Oh, we can probably improve macros
<asterite> though I'm not sure they will ever be as powerful as in elixir... I'm also not sure I'd like that
<asterite> jhass: I was thinking about generic types and splats... I think now it's good that we have Array(...), looks like a method call. And you can use splat, and named arguments there too (well, just for NamedTuple now)
<asterite> But I think the semantic shouldn't match that of method calls. For example I'd like Proc to be Proc(*T, R), as you said. In regular methods R would be a required named argument... but we don't want that
<asterite> In fact, I don't know if named arguments in a generic type other than NamedTuple is useful...
<jhass> yeah, totally not
<asterite> As a side note, yesterday I learned that block arguments in Ruby are a lot like method arguments
<asterite> you can use double splat, you can even use keyword arguments
<asterite> though I never saw that being used anywhere
<jhass> and I would say we ignore named generics until somebody comes up with a convincing usecase :)
<jhass> yeah, they are the same actually I think
<jhass> Method#arity and Proc#arity are basically the same method
<jhass> mh, not sure whether method arguments support unpacking, let's see
<jhass> (no, I don't think we should copy that)
get_drunk has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
<asterite> wow, I didn't know that
sfcg[away] is now known as sfcgeorge
Philpax has quit [Ping timeout: 252 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Raimondii has joined #crystal-lang
<BlaXpirit> for an interesting perspective, Python actually dropped this exact feature
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
ruslux has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
<asterite> I think it's ok from a purist point of view, but probably not very practical and maybe makes the implementation more complex
snsei has quit [Remote host closed the connection]
<jhass> yeah our argument matching is already complex enough now IMO :)
<jhass> for the user too
<get_drunk> we are too smart
ruslux has quit [Ping timeout: 250 seconds]
crack08 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soveran has quit []
sfcgeorge has quit [Quit: Textual IRC Client: www.textualapp.com]
ryanw-se has joined #crystal-lang
vikaton has joined #crystal-lang
<travis-ci> crystal-lang/crystal#4e8aa74 (master - Merge pull request #2761 from crystal-lang/feature/class_vars): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135876372
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/voLqU
<crystal-gh> crystal/master ff4891a Ary Borenszweig: Generics: allow splat argument to be in any position, together with more non-splat arguments
<crystal-gh> crystal/master 370db4c Ary Borenszweig: Make Proc be Proc(*T, R)
<crystal-gh> crystal/master 738fb36 Ary Borenszweig: Formatter: correctly format splat type arguments
<jhass> uhh
<jhass> <3
<asterite> E>
get_drunk has quit [Quit: Page closed]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
<travis-ci> crystal-lang/crystal#370db4c (master - Make Proc be Proc(*T, R)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135932135
paulcsmith_ has joined #crystal-lang
crystal-lang646 has joined #crystal-lang
crystal-lang646 is now known as jake-how
<jake-how> is Enum w/ flags the suggested way of doing something like this in crystal? https://basarat.gitbooks.io/typescript/content/docs/types/stringLiteralType.html
jamie_ca has quit [Ping timeout: 276 seconds]
braidn has quit [Ping timeout: 244 seconds]
g3funk has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jamie_ca has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
sp4rrow has joined #crystal-lang
<asterite> jake-how: just enum, without flags
<asterite> flags is when you'd like to combine two values
A124 has quit [Read error: Connection reset by peer]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A124 has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
paulcsmith_ has quit [Client Quit]
paulcsmith_ has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jake-how_ has joined #crystal-lang
<jake-how_> asterite: normal enum can handle shuttling back and forth between a string? I want to use this for mapping JSON values
paulcsmith_ has joined #crystal-lang
<jhass> sure
<jhass> jake-how_: well, the default Enum#to_json uses the integer value
<jhass> but @[Flags] doesn't change that
<jake-how_> ex: json -> {status: "pending"} where status can be "pending" | "active" | "suspended", and I have a class like this? https://gist.github.com/jakehow/0e05b86048fdd24095e248e56dd4b090
jake-how has quit [Ping timeout: 250 seconds]
<jake-how_> id like a way to make fromJSON and toJSON have the expected value
<jhass> the default from_json does handle strings
<jhass> to_json you have to override
rvchangue has quit [Ping timeout: 246 seconds]
TheLemonMan has joined #crystal-lang
rvchangue has joined #crystal-lang
<jhass> jake-how_: https://carc.in/#/r/10zb for example like this
<jhass> mmh, better https://carc.in/#/r/10zc
<jhass> asterite: what do you think of changing pp to print x #=> value ?
<jhass> instead of = which gets rather confusing with pp foo = bar or pp foo == bar
<asterite> Sounds like a good idea :)
<asterite> In any case pp is used for debugging, so it shouldn't bother or "break" something
<jhass> mmh, #=> or # =>
<asterite> I'd use `# => ...`
<jhass> cool
<asterite> that's what the formatter does, and seem to be recommended in Ruby
<asterite> On this topic, I'd eventually like to have a pretty print like in Ruby... I tried to implement it, but it's not trivial
<asterite> Ruby's is magical, it knows when to do a line break in the right place
<jhass> hehe
<asterite> so... maybe the current pp should have a different name
<jhass> did you see awesome_print?
<asterite> Oh, I think I used it a couple of times
<asterite> Maybe we can wait until someone implements awesome_print, ap, so there's no conflict :-P
<jake-how_> jhass: got it thanks!
<jhass> asterite: the most magical ruby gem in that are probably still is seeing_is_believing
<jhass> *area
<asterite> seems like our playground... didn't know such thing existed for Ruby
<jhass> mmh
<jhass> asterite: https://carc.in/#/r/10zd why doesn't it override?
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/voLVg
<crystal-gh> crystal/master d4f6b72 Jonne Haß: Change pp macro output from exp = value to exp # => value
<asterite> looks like a bug
<asterite> probably related to the splat argument
<jhass> issue?
rvchangue has quit [Ping timeout: 244 seconds]
<asterite> Please :-)
<asterite> I almost have implemented yield *args :-D
<asterite> `do |*args|` is a bit different, but shouldn't be that hard
Nik736 has joined #crystal-lang
<jhass> awesome
rvchangue has joined #crystal-lang
<jhass> haha, I got the do |*args| RFC as triage today
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<asterite> Sure it was today and not two days ago? :-)
<asterite> The nice thing is that this also helps with `delegate`, we could define an extra overload with a block that just forwards all args
<jhass> yes!
<asterite> Still won't work with captured block, but that's the only case left
sp4rrow has joined #crystal-lang
<asterite> :)
paulcsmith_ has joined #crystal-lang
<Yxhuvud> hm, you don't need the * there in ruby, right?
<travis-ci> crystal-lang/crystal#d4f6b72 (master - Change pp macro output from exp = value to exp # => value): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135966078
<jhass> Yxhuvud: where?
<Yxhuvud> do |args|
<jhass> well, yes and no, it's a bit complicated
<jhass> it helps to understand that yield actually supports only a single argument
<jhass> yield a, b is actually yield [a, b]
<Yxhuvud> hellishly complicated, but for that simple case.
<jhass> so an array
<jhass> so do |a, b| is actually do |(a, b)|, array unpacking
<Yxhuvud> ruby block argument assignent is an unholy marriage between the rules for normal argument lists and parallel assignment
<Yxhuvud> like you can have default args and stuff.
<jhass> now, say we yield a, b, c, do |a, *b| or do |*a, b| makes a lot of sense in that case
<jhass> but supporting just that without generalizing would be inconsistent
<jhass> hence do |*a| is supported
<jhass> the best feature is do |a; b|, who can tell me what it does? :P
<Yxhuvud> heh
<jhass> only place I know where ; is not \n
<jhass> (besides inside literals of course)
<Yxhuvud> (it is also allowed to use a trailing comma)
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/voL6w
<crystal-gh> crystal/master 48ca11a Ary Borenszweig: Compiler: some fixes around generic types
<crystal-gh> crystal/master 00492a6 Ary Borenszweig: Support splats in yields. Fixes #392
<jhass> uh oh, <3
<BlaXpirit> welp, i nominate crystal for the most consistent language ever
<asterite> :-D
<BlaXpirit> maybe 2nd to esperanto :D
<asterite> Well, in Esperanto "kolego" is both "big neck" and "colleague", so...
* BlaXpirit remembers the pull request that adds another meaning to the word "product"
<BlaXpirit> now array actually has 2 `product` methods that do different things
<BlaXpirit> well, 8 different methods, 4 of which do one thing and the other 4 (inherited from enumerable) do a different thing
<jhass> yeah I wasn't particularly fond of that either
<jhass> one issue is that math uses the same name for both operations too
<jhass> if you have any ideas for better names for either...
<BlaXpirit> the solution? don't make a shortcut {|a,b|a*b} -> product
<BlaXpirit> i mean reduce{|a,b|a*b}
<jhass> then we would need to drop .sum too
<jhass> ruby doesn't have either too
<BlaXpirit> all the languages that come to mind have 'sum' but not 'product'
<asterite> And Ruby added sum recently...
<jhass> and it is actually a pain point of the language
<jhass> really? didn't notice
<asterite> Seems so, saw it in a tweet
<asterite> It seems they also optimized [foo, bar].max
<jhass> so for 2.4 then?
<asterite> I think so, yes
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voL1e
<crystal-gh> crystal/master efd1598 Ary Borenszweig: Fixed #2773: Can't override macro with splat argument
<travis-ci> crystal-lang/crystal#00492a6 (master - Support splats in yields. Fixes #392): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135973252
<jhass> asterite: btw I still think that macro lookup should eventually interleave with method lookup, when it comes to looking into ancestors and parent namespaces at least
<asterite> I think it should be possible to do
<jhass> https://github.com/crystal-lang/crystal/issues/236 thought I had opened an issue for that
<shadowshell> hey crystal folks!
<shadowshell> thanks for all your work, crystal is looking really neat
<jhass> hey, thanks :)
<shadowshell> i've read the documentation and have been playing around with some code of my own
<shadowshell> i have a question about a pattern that is documented, but maybe not explained (at least enough to satisfy my personal curiosity)
<shadowshell> the pattern of assigning instance variable to locals, modifying the local, the reassigning the instance variable to the value of the mutated local
<shadowshell> iso
<shadowshell> so*
<shadowshell> the question is
<travis-ci> crystal-lang/crystal#efd1598 (master - Fixed #2773: Can't override macro with splat argument): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135977120
<shadowshell> is this a design decision to force explicitness around state mutation or a compiler limitation of some kind?
<shadowshell> just curious
<jhass> neither, it's preparation for parallelism
<jhass> thought we had a section in the docs about it somewhere but can't find it atm
<shadowshell> you do
<shadowshell> but it doesn't mention the "why" or i just missed it
<jhass> the issue is that in a parallel program, an instance variable may change at any point
<shadowshell> let me see if i can find the section
<shadowshell> sure, makes sense totally
<jhass> let me find the issue where I wrote up a bit longer explanation
<shadowshell> thanks!
<jhass> so you need it in order to do type reduction for example
<shadowshell> great, thanks for the link!
<jhass> in the example you linked, say we did return @socket if @socket; the compiler can't reduce the type of @socket removing the nil
<jhass> because it may change between the check of the if and the actual return
<jhass> if it then would reduce the type, there's a possibility where nil is returned while the return type doesn't include nil
<shadowshell> which is the exact behavior that was kicking me in the face when i started writing crystal and pretending it was ruby :)
<shadowshell> forcing me to read the docs
<shadowshell> and ask this question
<sp4rrow> I noticed the ci downloads the darwin version of llvm
<jhass> yes, it's one of the most common questions :)
<sp4rrow> wouldn't the standard linux install have a different llvm?
<jhass> sp4rrow: yes, the linux docker images have 3.6 installed from the repos
<jhass> which is actually good, since atm we kinda support both versions ;)
<jhass> so we get some test exposure against both too
<jhass> shadowshell: btw contributions towards making this clearer in the docs are more than welcome ;)
<shadowshell> indeed
<shadowshell> was just rereading the section mentioned in the comments you linked
<shadowshell> it does mention the parallelism part of the issue we are avoiding with this blurb "Another reason is that another thread could change that instance variable after checking the condition."
Ven has joined #crystal-lang
<shadowshell> but it could stand to be clearer
<shadowshell> is there a list of commonly asked things? do you have a gh issue for needed documentation?
<jhass> mh
<shadowshell> ahha
<shadowshell> interesting
<shadowshell> i'll look at those things and see where i can chip in
<shadowshell> thanks!
<jhass> well and I guess if you wanted you could look for patterns in https://github.com/crystal-lang/crystal/issues?utf8=%E2%9C%93&q=label%3Aquestion+ ;)
<shadowshell> fair enough. all good devs are in my experience
<jhass> jeez didn't think it's actually over 500
<crystal-gh> [crystal] lbguilherme opened pull request #2774: WebSocket: Add support for receiving binary messages (master...patch-4) https://git.io/voLQs
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
<sp4rrow> just curious it looks like llvm is on version 3.8 and crystal is on 3.6 is there a reason to not upgrade?
<sp4rrow> mostly just curious
<sp4rrow> is seems like it is pretty recent change as in the past few months
<asterite> sp4rrow: should be easy, but since it's working it's easier to just keep things like that instead of risking breaking something
<asterite> Mmm... we need to change the configuration in omnibus (the project that builds the releases), and some other things
<asterite> Basically, not a high priority right now
pawnbox has quit [Remote host closed the connection]
<sp4rrow> thanks
<sp4rrow> yeah the release notes where not that serious
<sp4rrow> seems like good incremental improvements
<sp4rrow> this is a github thing
<sp4rrow> but it seems like some PRs are just waiting on a few changes
<sp4rrow> I made a branch and was going to make a PR into someone elses PR
<jhass> asterite: still think it should be :(
<sp4rrow> is that possible
<jhass> sp4rrow: not without their collaboration
<sp4rrow> ah
<sp4rrow> interesting
<jhass> sp4rrow: so might be easier to just fetch their PR into a local branch, add your changes ontop and make a new PR
<sp4rrow> yeah I was hoping that would not be taken the wrong way
<sp4rrow> but I guess if it has been a few months that is probably not a problem
<jhass> usually isn't, I mean by taking over their commits you keep attribution
<sp4rrow> you can do that by just not touching there commits right
<sp4rrow> just adding on top of them
<jhass> yes
<sp4rrow> or is there a github way of marking the commit objects
<jhass> even squashing their commits together will retain their author info
<jhass> github just reads the author email from the commit
<sp4rrow> ok cool that makes sense
<sp4rrow> thanks
<sp4rrow> is there any community managed forum for crystal or should I just ask the google groups
<sp4rrow> I was going to see if there was some easy features ot work on
jake-how_ has quit [Ping timeout: 250 seconds]
<jhass> the google groups mailing list is just fine, for general (non contributing) questions there's also stack overflow
<jhass> and sometimes somebody uses the subreddit
<sp4rrow> thanks
<sp4rrow> I didnt know there was a reddit
<jhass> two actually -.-
<jhass> https://www.reddit.com/r/crystal_programming/ is where most people are
<sp4rrow> cool thanks
<jhass> https://www.reddit.com/r/crystal is the other one
<sp4rrow> really
<sp4rrow> weird
<jhass> yes
<jhass> hopefully someday somebody manages to merge them somehow
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/voLN9
<crystal-gh> crystal/master b8ea6a2 Ary Borenszweig: Revert "Fixed #2773: Can't override macro with splat argument"...
<crystal-gh> crystal/master 4502a4d Ary Borenszweig: Splat in block arguments. Fixes #1171
<jhass> what a beautiful day
<asterite> :-)
<asterite> I'm working a lot with the compiler lately, not so much with the standard library, and I feel I know it better now and know where to make changes :-)
<sp4rrow> I would like to hear your thoughts on that
ozra_ has joined #crystal-lang
<sp4rrow> is there anywhere you are writing or talking about that?
<jhass> asterite: soo, then Array(Object) next? :P
<jhass> (j/k)
ozra_ has quit [Ping timeout: 276 seconds]
ozra_ has joined #crystal-lang
<asterite> :-P
<asterite> Mmm.. that touches generics a bit, I'll wait for waj to come back for that
ozra_ has quit [Ping timeout: 240 seconds]
<asterite> I think we will have to use some macro code in Enumerable after all...
<asterite> Array(T) is Enumerable(T), Hash(K, V) is Enumerable(K, V)
ozra_ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#4502a4d (master - Splat in block arguments. Fixes #1171): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/135998078
<asterite> but when you do select you want a single type for the array, but you want a tuple for the hash
<asterite> So basically all methods must check the size of T?
<jhass> asterite: huh, Enumerable(Foo) should make T {Foo}, no?
<asterite> Yes
<asterite> but we don't want select to return Array({Foo})
<jhass> and Array(*{Foo}) should be Array(Foo)?
<asterite> Yes
<asterite> Now consider a Hash, it's Enumerable(K, V), but you want select to return Array({K, V})
<asterite> and not Array(K, V)
<jhass> ah, mh
<asterite> that would result of splatting T
<jhass> mmmh
<asterite> So magical, Ruby...
ozra_ has quit [Remote host closed the connection]
ozra_ has joined #crystal-lang
<jhass> allow reassigning T! {% T = T[0] if T.size == 1 %}
<jhass> maybe not...
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<asterite> but the body changes, in one case we splat the block argument, in the other no
<asterite> or we could always splat it there, but then `push` needs to splat or not splat
<asterite> Well, we have to think a bit more
<asterite> see ya!
<jhass> yeah
<jhass> bye!
ozra_ has quit [Ping timeout: 240 seconds]
ozra_ has joined #crystal-lang
<jhass> asterite: https://p.jhass.eu/2j.cr
<jhass> eh wrong way around
sp4rrow has joined #crystal-lang
<jhass> mmh
ozra_ has quit [Read error: Connection reset by peer]
Raimondii has joined #crystal-lang
ozra_ has joined #crystal-lang
<jhass> asterite: https://p.jhass.eu/2k.cr kinda weird semantic for the method, but...
<Yxhuvud> the heisensplat?
Raimondi has quit [Ping timeout: 240 seconds]
<Yxhuvud> can't you do something similar to ruby? some classes include Enumerable, but still implement their own specializations of certain methods. Hash could define each to yield a pair.
<jhass> that's what we're currently doing
<jhass> but if we can avoid that boilerplate, why not
<jhass> especially since we have like 3 or 4 Hash like types
Raimondii is now known as Raimondi
ozra_ has quit [Read error: Connection reset by peer]
<Yxhuvud> autosplatting like that seems like going down the same rabbithole of complexity ruby walked down. eventually someone will want to combine them with default arguemnts and whatnot.
<Yxhuvud> -> bed
<jhass> it's not autosplatting though ;)
ozra_ has joined #crystal-lang
<jhass> it's just that Enumerable splats
<jhass> sleep well!
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ozra_ has quit [Ping timeout: 250 seconds]
ozra_ has joined #crystal-lang
get_drunk has joined #crystal-lang
<get_drunk> literally everywhere I go to read stuff, someone in the comments asks "does crystal have windows support yet?"
<jhass> one would imagine there's enough people that they'd built a joint effort to do it
<get_drunk> i'd imagine a 100 billion dollar company could make an os that doesnt suck to begin with
<get_drunk> but i guess that would just be stupid
<jhass> asterite: https://p.jhass.eu/2l.cr latest thoughts, hide the Array.new decision on one place and reuse, gonna sleep over it
<get_drunk> what can a stupid person be doing to benefit crystal right now?
<jhass> write some stupid standard library code or docs!
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<jhass> write some awesome tool or library
<jhass> pester us with all the bugs you find in the process
<get_drunk> on a scale of 0 to don't, how good of an idea would it be to find cool, unmaintained ruby projects and port them to crystal?
<jhass> there's probably some unmaintained crystal projects by now that could use porting to latest
<jhass> but depends on the project
<jhass> much stuff is better off just taking the core concept and trying to find an idiomatic API and implementation for Crystal
<get_drunk> also how does gitbook work? I dont see where I would actually submit documentation commits
<jhass> CI will rebuilt it for ya
<get_drunk> ah, ok I see
trapped has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
get_drunk has quit [Quit: Page closed]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]