jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.8.0 | Fund Crystals development: http://is.gd/X7PRtI | 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
havenwood has joined #crystal-lang
greengriminal has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 264 seconds]
jeromegn has quit [Quit: jeromegn]
thelonelyghost has joined #crystal-lang
<thelonelyghost> Trying to hack on some OS-specific code and preparing for crystal being cross-platform to non-unix systems. Is there an equivalent to RUBY_PLATFORM here?
havenwood has quit [Ping timeout: 252 seconds]
miah has joined #crystal-lang
waj has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
waj has joined #crystal-lang
qard has quit [Quit: Textual IRC Client: www.textualapp.com]
waj has quit [Remote host closed the connection]
waj_ has joined #crystal-lang
Philpax has quit [Ping timeout: 255 seconds]
havenwood has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
Philpax has joined #crystal-lang
greengriminal has joined #crystal-lang
<crystal-gh> [crystal] waj pushed 2 new commits to master: http://git.io/vnWS0
<crystal-gh> crystal/master 899b866 Juan Wajnerman: Debug metadata for char, float and bool types
<crystal-gh> crystal/master f110cc2 Juan Wajnerman: Debug metadata for enum types
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 256 seconds]
greengriminal has quit [Quit: Leaving]
<travis-ci> manastech/crystal#f110cc2 (master - Debug metadata for enum types): The build passed. https://travis-ci.org/manastech/crystal/builds/81322248
kulelu88 has quit [Quit: Leaving]
<dzv> jhass: does #1527 cause problems by itself? would it be possible to merge as i have other branches waiting on it
<dzv> problem with HEAD. in ./src/llvm/di_builder.cr:55: argument 'value' of 'LibLLVMExt#di_builder_create_enumerator' must be Int64, not Int32
waj_ has quit [Remote host closed the connection]
<dzv> nevermind. my crystal version was too old
Philpax has quit [Ping timeout: 250 seconds]
Philpax has joined #crystal-lang
trapped has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
thelonelyghost has quit [Quit: Leaving]
Neverdie has quit [Quit: http://radiux.io/]
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Herbstein has joined #crystal-lang
<Herbstein> Tb
<Herbstein> There's a problem with the dependencies on Ubuntu
<Herbstein> libssl-dev isn't included in the install but is needed in the simple HTTPServer example
Herbstein has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<jhass> dzv: saw my link?
Philpax has quit [Ping timeout: 250 seconds]
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vnlrm
<crystal-gh> crystal/master 0e73fe8 pgkos: Reimplemented glob in Crystal
<crystal-gh> crystal/master 9664d24 Jonne Haß: Merge pull request #1487 from pgkos/recursive-glob...
leafybasil has quit [Remote host closed the connection]
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vnloZ
<crystal-gh> crystal/master 2d2786c Technorama Ltd: Make Future lazier. Don't spawn an additional Fiber with lazy.
<crystal-gh> crystal/master 5669fb4 Jonne Haß: Merge pull request #1527 from technorama/f/retirement...
havenwood has quit [Ping timeout: 246 seconds]
<travis-ci> manastech/crystal#9664d24 (master - Merge pull request #1487 from pgkos/recursive-glob): The build was broken. https://travis-ci.org/manastech/crystal/builds/81347965
chdorner has joined #crystal-lang
<travis-ci> manastech/crystal#5669fb4 (master - Merge pull request #1527 from technorama/f/retirement): The build passed. https://travis-ci.org/manastech/crystal/builds/81348671
<chdorner> I wanted to add some things to the docs (the ones done with gitbook, http://crystal-lang.org/docs/) but couldn't find where files live. Can anybody point me in the right direction?
<travis-ci> manastech/crystal#9664d24 (master - Merge pull request #1487 from pgkos/recursive-glob): The build passed. https://travis-ci.org/manastech/crystal/builds/81347965
leafybasil has joined #crystal-lang
leafybas_ has joined #crystal-lang
jtarchie has quit [Remote host closed the connection]
chdorner has quit [Remote host closed the connection]
AckZ has quit [Remote host closed the connection]
iamstef has quit [Remote host closed the connection]
emmanueloga has quit [Remote host closed the connection]
guilleiguaran__ has quit [Remote host closed the connection]
<jhass> I'd love to but you would have to stick around for more than 5 minutes
leafybasil has quit [Ping timeout: 268 seconds]
guilleiguaran__ has joined #crystal-lang
iamstef has joined #crystal-lang
AckZ has joined #crystal-lang
emmanueloga has joined #crystal-lang
<jokke> will crystal ever have the possibility to use compiled crystal libraries?
<jokke> as in shared libraries
<jokke> i imagine type checking to be a major problem then
<crystal-gh> [crystal] adlerhsieh opened pull request #1537: Add note to option_parser (master...master) http://git.io/vnl9B
<jhass> https://github.com/manastech/crystal/issues/921 (and referencing issues)
<jokke> ah
<crystal-gh> [crystal] chdorner opened pull request #1538: Add installation docs for Arch Linux (gh-pages...installation-docs-arch-linux) http://git.io/vnl9K
<jokke> what is GC?
<jokke> ah
<jokke> garbage collection
<crystal-gh> [crystal] jhass closed pull request #1538: Add installation docs for Arch Linux (gh-pages...installation-docs-arch-linux) http://git.io/vnl9K
<crystal-gh> [crystal] adlerhsieh closed pull request #1537: Add note to option_parser (master...master) http://git.io/vnl9B
jtarchie has joined #crystal-lang
Philpax has joined #crystal-lang
chdorner has joined #crystal-lang
Philpax_ has joined #crystal-lang
chdorner__ has joined #crystal-lang
chdorner__ has quit [Client Quit]
Philpax has quit [Ping timeout: 255 seconds]
chdorner has quit []
Philpax_ has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
chdorner has joined #crystal-lang
<trapped> how do i use the yielded data as an argument in the one-liner block syntax? e.g. you can do `[".", "..", "style.css", "logo.png"].reject!(&.=~(/\.+/).== 0) # ["style.css", "logo.png"]` but not `.reject!([".", ".."].includes? &.itself)`
<jhass> I don't get the intention of the last one
<jhass> what would be its long form?
<trapped> .reject! do |elem| \ [".", ".."].includes? elem \ end
<trapped> basically remove elements from an array if they're included in another array
<trapped> i'd like to do it as an one-liner
<trapped> currently i'm working around thanks to the fact i know the element type is string
<trapped> i'd also like to prepend text to strings in an array using .map: `["a", "bcd"].map("/#{&.itself}") # ["/a", "/bcd"]`
<trapped> long form http://carc.in/#/r/gd0
<jhass> well, the point of the shortcut syntax is to not have to explicitly specify the parameter, so you can't explicitly refer to the parameter
<jhass> use the long form
<trapped> alright
<jhass> curly braces are much nicer when you chain ;)
<trapped> only when they work http://carc.in/#/r/gd2
<jhass> http://carc.in/#/r/gd3 could also use Array#- for this case
<jhass> trapped: it's still a block
<jhass> you wouldn't do foo(do |x| ..; end) either, would you?
<trapped> right right, the newlines
<jhass> no, the parens
<trapped> Array#- seems the best way
<trapped> that'd work in ruby so i thought it'd work here too
<jhass> no it wouldn't
<trapped> hmmm
<jokke> are there any gtk bindings for crystal?
<jokke> i couldn't find anything on github at least.
<chdorner> I am getting two errors when trying to build crystal myself (or generate the docs with `make doc`). It used to work on Friday IIRC. Travis seems to be happily building, so there might something weird on my machine. I'm on the lastest commit 5669fb4.
<trapped> you missed a couple builds
<trapped> your compiler is too old to compile itself
<chdorner> the one on my system? That one should be 0.7.7
<trapped> you need at least 0.8.0
<jhass> jokke: jhass/crystal-gobject has some rough/early stuff
<jokke> ok
<jokke> thanks
<jhass> jokke: contributions welcome, if you want to have explained how it works just ask
<jhass> chdorner: git checkout 0.8.0; make; git checkout master
<chdorner> Ah, that worked. Thanks!
<jokke> jhass: sure
<jhass> so, do you know about gobject-introspection?
<trapped> "Unexpected event NONE (Exception)" https://gist.github.com/trapped/e51da441ae5b151013f1
<jhass> ah well, guess you found an issue in the yaml binding
<trapped> gonna look into it
<trapped> only had to update shards
Ven has joined #crystal-lang
ssvb has quit [Ping timeout: 256 seconds]
pawnbox_ has joined #crystal-lang
waj has joined #crystal-lang
Philpax_ has joined #crystal-lang
waj has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 265 seconds]
<jokke> jhass: have you updated?
<jokke> i can't build crystal because of ncurses
<jhass> jokke: rm -rf src
<jokke> jhass: ok
<jokke> yup
<jokke> works
<pawnbox_> pointer.cr seems to have incomplete implementation of hash_address.
<pawnbox_> line 288
shadeslayer has quit [Remote host closed the connection]
<pawnbox_> That's causing my crystal build to fail.
<jhass> pawnbox_: def_hash is a macro
<jhass> huh
<jhass> could you put the full error into a gist?
<pawnbox_> shit
<pawnbox_> Oh i raised a pull request
<pawnbox_> sry issue
shadeslayer has joined #crystal-lang
<chdorner> pawnbox_: that's the exact issue I had this morning, you need crystal 0.8.0 to build it
<chdorner> meaning, the compiler is too old to build itself
<pawnbox_> so i have brew install new crystal
<jhass> I commented on your issue
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pawnbox_> thanks jhass
pawnbox_ has quit [Ping timeout: 265 seconds]
<jokke> jhass: how did you handle signals in you gobject lib?
<jokke> g_signal_connect_data
<jokke> or rather what type is Callba ck
Philpax_ has quit [Quit: Leaving]
<jokke> and Callback is a struct?
<jokke> i thought one must pass a function pointer
<jokke> mhm ok
<jokke> and what if i need to return something from the proc?
<jokke> or rather get arguments
<jokke> crystal won't let me cast Foo -> Bar to -> Void
<jhass> I said it's early :P
<jokke> mmh
<jhass> which signal for example?
<jokke> activate on g_application
jeromegn has joined #crystal-lang
jeromegn has quit [Ping timeout: 240 seconds]
jeromegn_ has joined #crystal-lang
<jhass> now doing overloads for each possible signal doesn't sound right either :/
<jokke> not really, no :)
<jhass> though atm I don't see anything besides generating a connect overload similar to https://github.com/jhass/crystal-gobject/blob/master/src/notify/notification.cr#L73
<jhass> so https://github.com/jhass/crystal-gobject/blob/master/src/g_i_repository/info/signal_info.cr#L6 would need to generate an alias (with the help of CallableInfo, basically the same as CallbackInfo, and yield a wrapper_definition that defines a connect overload
<jhass> or rather something like def on_foo(&block : LibX::FooSignal) that uses Box to wrap the block and connect
<chdorner> can I have some feedback if this is alright before I continue adding documentation to more methods? https://github.com/chdorner/crystal/commit/c9c63d232ab23ed9cb5fffeefc839c7bf2ae3da2
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
havenwood has joined #crystal-lang
<jhass> I think most existing docs use *foo* to refer to the arguments
<jhass> And our doc reference convention is slightly different, `Hash#fetch` still applies, but class methods are referred to like `Hash.new`
<jhass> puts calls to_s, puts "#{foo}" is an anti pattern in both Ruby & Crystal
greengriminal has joined #crystal-lang
<jhass> the quotes in puts x #=> "foo" could be confusing, since they wouldn't be printed and puts returns nil
<jhass> chdorner: that's all I have, looks good otherwise
<jokke> jhass: are there any examples for the curses module?
<jokke> there's 0 documentation
<jokke> jhass: nothing happens if i run that
Neverdie has joined #crystal-lang
* jhass shrugs
<jokke> :/
<chdorner> jhass: thanks. Will change these things. how do you mean that most existing docs use *foo* to refer to the arguments?
<jhass> literally *foo* instead of `foo`
<jhass> keep in mind it's markdown, sort of :P
<chdorner> that's why I did it with backticks, to make it render in a <code> tag
<chdorner> but what you're saying is that
<chdorner> h.fetch("foo", nil) #=> *nil*
<chdorner> is more commonly used than
<chdorner> h.fetch("foo", nil) #=> `nil`
<chdorner> ?
<jhass> no
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<chdorner> okay, then I dont' understand what you mean, sorry
<jhass> That "Returns `true` if `key` exists in the hash" is commonly pictured as "Returns `true` if *key* exists in the hash"
<chdorner> ah okay, now I got it. * for variable names (like arguments), ` for values
<chdorner> will change
Ven has joined #crystal-lang
<chdorner> jhass: and generally the goal is to have short documentation for each public method? (long term obviously)
<jhass> sure
<Netfeed> chdorner: just submit code and jhass will document it :P
<Netfeed> *cough*
<chdorner> haha, didn't happen to the code in the Hash class :P
<jhass> Netfeed: you mean and I will tell other people to document it :P
<Netfeed> worked for HTTP::Cookie at least
<chdorner> I mean it's mostly fine for people coming from Ruby, most methods do the same or at least a similar thing, but it's good to have the public API methods documented for non-Ruby people IMO
<jhass> sure, definitely wanted
pawnbox has quit [Ping timeout: 240 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jokke> jhass: how would something like this be included in crystal? https://p.jreinert.com/XbBE/
pawnbox_ has joined #crystal-lang
<jokke> i tried defining an enum and using a macro for NCURSES_BITS but i got invalid constant value errors then
<jhass> enum sounds good, maybe you need to change its type or the output type of your macro?
<jhass> oh, actually I remember https://github.com/manastech/crystal/issues/424 now
<jokke> ah i see :/
Ven has joined #crystal-lang
<pawnbox_> Well this might be a noob question, but i am not able to run test for shards
<jhass> pawnbox_: you need to install minitest using shards first :P run `shards` or `crystal deps`
<pawnbox_> in short : to run a dependency manager use other dependency manager.
kostya has joined #crystal-lang
<jhass> well, rather "to run the test for the dependency manager run the same dependency manager first" :P
<pawnbox_> Aha
<pawnbox_> got it.
<pawnbox_> finally i have some test running.
<pawnbox_> jhass: I have this error : ld: warning: directory not found for option '-L/opt/homebrew/lib'
<pawnbox_> Why is this directory linked?
<pawnbox_> for libyaml?
<jhass> I guess
<jhass> keep in mind that ysbaddaden has no OS X machine to test against
<jokke> jhass: hm
<jokke> i just get Error invalid constant value
<jokke> but no line number
kostya has quit [Ping timeout: 256 seconds]
<pawnbox_> I have these libs inside /usr/local/Cellar
<jhass> jokke: meh
<jokke> jhass: anything obvious?
<jhass> open an issue for that one already :P
<jhass> pawnbox_: best edit the Makefile accordingly
<jokke> jhass: why? you already have
<pawnbox_> yep that's what i'll have to do.
<jhass> jokke: "unhelpful error message" ?
<jhass> can't remember I did
<jokke> ah ok
<jhass> jokke: okay I guess the issue is that << is a method call, thus runtime
<jhass> and atm constant values need to be known at compile time
<jhass> mmh, dunno, I thought I did such things already
<jhass> jokke: looks like the ~ is not supported
<jokke> ah ok
<jhass> your next issue ;)
pawnbox_ has quit [Remote host closed the connection]
<jokke> done
<crystal-gh> [crystal] pgkos opened pull request #1544: Fix some typos in toplevel.html (gh-pages...docs-toplevel-stdout) http://git.io/vn46T
chino_ has joined #crystal-lang
<dzv> jhass: Process.waitpid used to call waitpid directly. now the signal handler for SIGCHLD must be invoked before waitpid will return anything
<dzv> in playpen the signals are never sent CHLD
<dzv> for CHLD
<dzv> there is a zombie process waiting which is why waitpid called directly works
<jhass> is this something we can fix in crystal or would you say this is a bug in playpen?
<jhass> (or maybe both I guess)
<dzv> 80% sure playpen but i need to construct a separate test to rule out crystal
<jhass> yeah, a small .c reproducing would be awesome in order to report it to playpen
Neverdie has quit [Quit: http://radiux.io/]
kostya has joined #crystal-lang
jeromegn_ has quit [Read error: Connection reset by peer]
Neverdie has joined #crystal-lang
jeromegn has joined #crystal-lang
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #1544: Fix some typos in toplevel.html (gh-pages...docs-toplevel-stdout) http://git.io/vn46T
<kostya> why you remove length for strings O_O
<jhass> because size is better™ :P
<jhass> we wanted to drop the alias and size had the bigger camp, sorry
Liothen has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] pgkos opened pull request #1545: Fix typos in kernel.cr comments (master...kernel-comments-stdout) http://git.io/vn4Xs
NeverDie_ has joined #crystal-lang
NeverDi__ has joined #crystal-lang
NeverDie_ has quit [Read error: Connection reset by peer]
Liothen has joined #crystal-lang
Neverdie has quit [Ping timeout: 256 seconds]
NeverDi__ is now known as NeverDie
gamemanj has joined #crystal-lang
waj has joined #crystal-lang
chino_ has quit [Ping timeout: 246 seconds]
waj has quit [Remote host closed the connection]
waj has joined #crystal-lang
chino_ has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
<crystal-gh> [crystal] chdorner opened pull request #1546: Add missing link to Arch Linux installation (gh-pages...add-missing-arch-installation-link) http://git.io/vn49b
<crystal-gh> [crystal] jhass closed pull request #1546: Add missing link to Arch Linux installation (gh-pages...add-missing-arch-installation-link) http://git.io/vn49b
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] jhass closed pull request #1545: Fix typos in kernel.cr comments (master...kernel-comments-stdout) http://git.io/vn4Xs
Liothen has joined #crystal-lang
Liothen has quit [Changing host]
<travis-ci> manastech/crystal#21c3d53 (master - Merge pull request #1545 from pgkos/kernel-comments-stdout): The build passed. https://travis-ci.org/manastech/crystal/builds/81407701
NeverDie has quit [Quit: http://radiux.io/]
pawnbox has quit [Remote host closed the connection]
waj has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vnBYw
<crystal-gh> crystal/master 43346f1 Ary Borenszweig: Fixed #1542: missing location of "~" call
<crystal-gh> crystal/master a79c991 Ary Borenszweig: Fixed #1543: support `~` in enum constants
<dzv> is there a forwardable or delegated class somewhere?
waj has joined #crystal-lang
NeverDie has joined #crystal-lang
<travis-ci> manastech/crystal#a79c991 (master - Fixed #1543: support `~` in enum constants): The build passed. https://travis-ci.org/manastech/crystal/builds/81417042
chino_ has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] adlerhsieh opened pull request #1547: add ecr library usage (master...master) http://git.io/vnBcq
<chdorner> is there a way to check if a class implements the abstract `<=>` method?
<chdorner> every class seems to have it because it's defined as an abstract method in Object
<chdorner> but `(-> {}) <=> (-> {})` raises an error saying that the `<=>` method needs to be implemented
<chdorner> as an example
<dzv> perhaps "abstract <=>" should be moved to Comparable
<chdorner> sounds reasonable to me
<chdorner> I'll draft something up
NeverDie has quit [Quit: http://radiux.io/]
NeverDie has joined #crystal-lang
BlaXpirit has joined #crystal-lang
<jokke> how would i define instance methods on a class that expand the attributes in macro context?
<jokke> or isn't this possible?
<jhass> that what?
<jokke> this won't work
havenwood has quit [Ping timeout: 246 seconds]
<jhass> .argify perhaps?
<jokke> argify?? :D
<jokke> i still don't understand at what point i should use that
<jhass> ah, thought your issue is in the call
<jhass> macro def's can only take runtime args
<jhass> make them regular macros perhaps?
<jokke> but then i wouldn't have access to self
<jhass> sure not?
<jokke> no :)
<jhass> you tried?
<jokke> but if i use a normal macro, wouldn't that then be like a class method?
<jhass> I guess
<jokke> is there some hook at which i could define the methods?
<jhass> idk
<jhass> this is why I want something like Julia's generator methods
<jhass> basically macro defs that take compile time args and overload on those
chino_ has joined #crystal-lang
willl has joined #crystal-lang
greengriminal has quit [Ping timeout: 246 seconds]
greengriminal has joined #crystal-lang
<asterite> kostya: about size, look at this: http://play.crystal-lang.org/#/r/gf9
<asterite> if we have length, size, count, you can't do that generic algorithm. Well, you can, but you have to ask each collection implementor to please provide all aliases, which is boring and tedious
<jhass> asterite: http://carc.in/#/r/g59 this is as far as I got, any other ideas?
<asterite> Standarizing on a single name is simpler and better
apt-get has joined #crystal-lang
<asterite> jhass: wow
<asterite> I was going to suggest a flag to the compiler to not issue an error on nested definitions
<jhass> well, I think my example shows that the macro approach doesn't work
<asterite> Mmm... why do you need to wrap the code in the first place?
<jhass> so this
<asterite> Oh, because it doesn't `puts` it?
<jhass> >> 1
<DeBot> jhass: # => 1 - http://carc.in/#/r/gfa
<jhass> has any output at all
<asterite> So maybe we can add an option to the compiler to print the output, so it'll do it for you?
<asterite> So any tool that wants to "eval" code can do it
<jhass> mmmh
<jhass> just had a thought, maybe I can just extract the last expression with that method
<jhass> and even check if I can wrap it to some degree
<jhass> >> record Foo, foo; # if this errors
<DeBot> jhass: # => nil - http://carc.in/#/r/gfb
<jhass> >> record Foo, foo; Foo.new(1) # while this works it's acceptable I guess
<DeBot> jhass: # => Foo(@foo=1) - http://carc.in/#/r/gfd
<asterite> Strange, that should error :-P
<jhass> I pinned the bot to 0.7.6 for now
qard has joined #crystal-lang
apt-get has quit [Read error: Connection reset by peer]
apt-get has joined #crystal-lang
<jhass> oO http://carc.in/#/r/gfm why doesn't the debug trigger?
havenwood has joined #crystal-lang
<jhass> oh, me, forgot to change the name :D
<jhass> oh well http://carc.in/#/r/gfn
<jhass> no pop
<jhass> no delete either? :(
<jhass> mmh, size
<jhass> can I get the index?
<jhass> well I guess that works http://carc.in/#/r/gfx
<jhass> fucks up line numbers but oh well
<jhass> asterite: http://carc.in/#/r/gfy btw bug or am I missing something?
<asterite> Oh, try to do {% exp
<asterite> expr
<asterite> with a space
<asterite> otherwise it thinks it's {% ... %}
<asterite> that's an issue with macro variables, maybe we should choose another character for them
<jhass> ah indeed
<BlaXpirit> what a mess :(
greengriminal has quit [Quit: This computer has gone to sleep]
<kostya> http://play.crystal-lang.org/#/r/gga why this not work?
<jhass> Array#select will always return an array with same type
<jhass> the compiler would have to special case it if not
<BlaXpirit> jhass, hm i tried this http://play.crystal-lang.org/#/r/ggb
<jhass> BlaXpirit: close, it needs to go into a chained map
DeBot has quit [Quit: Crystal IRC]
<BlaXpirit> oh i didn't realize my addition made no sense
DeBot has joined #crystal-lang
<BlaXpirit> i made Bool as Int xD
<jhass> >> 1
<jhass> meh
<jhass> >> 1
async_prince has joined #crystal-lang
<jhass> malformed format string - %'}'
<jhass> -.-
<jhass> now I have to think of another unique token that I can gsub...
<jhass> okay, maybe not unique
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
<jhass> >> 1
<jhass> okay, I'll use a test instance
<jhass> asterite: eh? http://carc.in/#/r/ggd
<RX14> these java programmers... type annotating everything...
<gamemanj> RX14 is complaining about me.
<RX14> :3
<gamemanj> Apparently I'm too java-y for his tastes.
<gamemanj> Should I convert into a mocha for him? Or maybe a mocha-latte?
<RX14> you use crystal as if it's strongly typed
<RX14> well, it is
<RX14> you know what i mean
<RX14> damnit
<jhass> it's even statically typed :P
<asterite> jhass: I think the parser removes the expression from the Expressions, so there are less nodes around
<jhass> "as if there's no type inference" ;)
<jhass> asterite: :(
<RX14> but you aren't meant to annotate every functions return AND every argument's type
<gamemanj> Maybe not, but why allow annotation if you don't expect me to use them.
<jhass> asterite: any bug around that I can abuse? :P
<RX14> or make abstract classes for the sake of abstract classes like you do in java
<jhass> http://carc.in/#/r/gge mmh I guess
<jhass> sigh
<gamemanj> Hey, I would've used an interface if it was possible.
<jhass> Crystal is too smart!
<RX14> that's the problem
<RX14> this is duck typed
<asterite> I think it should just return an Expressions in that case, I though I removed that "feature", but apparently not
<RX14> the intracface IS the usage
<asterite> jhass: You could do: if exprs.is_a?(Expressions)
<jhass> begin; nil is simpler for now :P
<RX14> there's no problem with the code gamemanj, it's just you are creating boilerplate for yourself
<gamemanj> Maybe, but it's boilerplate that actually tells a user what the functions do
<RX14> creating extra work for no gain
<gamemanj> and how to implement them
kostya has quit [Remote host closed the connection]
<gamemanj> Technically all code comments are extra work for no gain, by similar standards
<gamemanj> They don't do anything program-wise, are basically an annotation...
<gamemanj> I'm sure they can all be inferred by the code!
<RX14> but nobody will ever use your thing
<gamemanj> So?
<RX14> and once they do, addding docs like that is easy
n0xff has joined #crystal-lang
<gamemanj> I've thought of a good tool for Crystal to have...: remove_annotations
<gamemanj> meant for recovering Java programmers :)
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
<jhass> >> 1
<DeBot> jhass: # => 1 - http://carc.in/#/r/gh3
pragmatism has joined #crystal-lang
vifino has quit [Ping timeout: 246 seconds]
vifino has joined #crystal-lang
async_prince has left #crystal-lang ["WeeChat 0.4.3"]
greengriminal has joined #crystal-lang
pragmatism has quit [Remote host closed the connection]
pragmatism has joined #crystal-lang
leafybas_ has quit [Ping timeout: 240 seconds]
chino_ has quit [Ping timeout: 246 seconds]
havenwood has quit [Ping timeout: 264 seconds]
leafybasil has joined #crystal-lang
<crystal-gh> [crystal] waterlink opened pull request #1548: Dismantle CGI module (master...kill-cgi) http://git.io/vnRVF
pawnbox has joined #crystal-lang
<chdorner> I would like to implement a SortedSet class, looking at the Ruby example they have a version using the Red-Black Tree algorithm (when the rbtree gem is installed), and otherwise use a slower implementation which basically just sorts the `keys` Array of the internal Hash. Now I've seen that there is a Red-Black Tree example (samples/red_black_tree.cr) which
<chdorner> got ported over from rubinius, is it possible to just move that code over to standard lib (plus adding tests), or would that not be acceptable?
kulelu88 has joined #crystal-lang
vifino has quit [Ping timeout: 246 seconds]
<BlaXpirit> chdorner, contributing to crystal repository based on something from crystal repository?
<BlaXpirit> how can that be unacceptable?
<BlaXpirit> other question is whether it needs to be there
<BlaXpirit> (in my opinion, yes, but it means nothing)
<chdorner> I was just asking because of the note on top of the file (`# Copied with little modifications from: https://github.com/rubinius/rubinius-benchmark/blob/master/real_world/bench_red_black_tree.rb`)
<BlaXpirit> oooh that's more interesting then
<BlaXpirit> to me it looks like it's already license violation
vifino has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vnRPs
<crystal-gh> crystal/master c55669f Ary Borenszweig: Fixed #1540: better error message when output file is directory
<jhass> BlaXpirit: nah we asked them on these matters, they're okay if we keep such a note
<BlaXpirit> pretty sure they can still sue xD
<chdorner> jhass: so it would be okay to move it into `src/` so it can be used?
<jhass> idk, I guess?
<jhass> no idea how general or optimized it is
havenwood has joined #crystal-lang
<chdorner> the other option would be to do what Ruby does, which doesn't seem very optimised, but the implementation would be much easier
<chdorner> (not using red-black tree, but just sorting the hash.keys array on access)
<BlaXpirit> then there is not much point to it
<asterite> I don't think it's optimized, I'd use Nil instead of a NilNode
trapped has quit [Read error: Connection reset by peer]
<travis-ci> manastech/crystal#c55669f (master - Fixed #1540: better error message when output file is directory): The build passed. https://travis-ci.org/manastech/crystal/builds/81457094
<pawnbox> how do i run compiler specs
<jhass> make spec
<pawnbox> i tried crystal run spec/compiler/codegen/class_spec.cr, it failed.
<jhass> try without run
<jhass> crystal spec/compiler/codegen/class_spec.cr
<jhass> ah, meh, bin/crystal actually
<pawnbox> I was taking a look at this issue : https://github.com/manastech/crystal/issues/1522
<pawnbox> If Base.foo wasn't there it works fine.
[spoiler] has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
[spoiler] has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
<kulelu88> Is there a dockerfile for crystal?
<kulelu88> 1 more question, does crystal have a package manager?
<jhass> ?shards=Crystal's package manager is currently developed at https://github.com/ysbaddaden/shards
<DeBot> jhass: Set shards.
<kulelu88> Also, has anyone seen this: https://crystal.sh/ ?
kulelu88 has quit [Changing host]
kulelu88 has joined #crystal-lang
<jhass> yes, idiot didn't want to change its name
NeverDie has quit [Quit: http://radiux.io/]
<jhass> (crystal is at least two years older)
<kulelu88> looks like an interesting project. would be weird to have a "crystal code generator" in crystal.sh :D
<BlaXpirit> UGH shards pulls a minitest dependency
<BlaXpirit> if minitest is included in stdlib i'll be so disgusted
<jhass> well, you've seen it has a spec DSL too?
shama has joined #crystal-lang
NeverDie has joined #crystal-lang
<BlaXpirit> yes, i hate that too but at least it's mild
<BlaXpirit> whenever i see class syntax used for tests, i cringe SO HARD
willl has joined #crystal-lang
qard has quit [Quit: Textual IRC Client: www.textualapp.com]
<RX14> i don't see the point of crystal.sh
gamemanj has quit [Ping timeout: 272 seconds]
<asterite> It's simple, instead of learning to program in a decent language, you program in yaml
<jhass> lol
<asterite> At least it's a step forward compared to when many wanted to program in xml
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vn0mD
<crystal-gh> crystal/master 380eb80 Ary Borenszweig: Fixed #1522: Compiler error when when class method calls `super`
<jhass> ah I see you fixed the issue pawnbox wanted to look into? :P
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vn03H
<crystal-gh> crystal/master 72d72a2 Benoist Claassen: added connect time out to http client
<crystal-gh> crystal/master 9423b4c Jonne Haß: Merge pull request #1520 from benoist/master...
BlaXpirit has quit [Quit: Konversation]
apt-get has quit [Remote host closed the connection]
<travis-ci> manastech/crystal#380eb80 (master - Fixed #1522: Compiler error when when class method calls `super`): The build passed. https://travis-ci.org/manastech/crystal/builds/81475982
<jokke> jhass: how can i use something else as STDIN?
<jokke> i need to pipe stuff to my program and then get user input
<jokke> so i'd like to open /dev/tty and assign it to STDIN
<crystal-gh> [crystal] porras opened pull request #1549: File#truncate (master...File#truncate) http://git.io/vn0Cm
<jhass> I don't think you can
<jhass> that's why Ruby uses globals I guess
<jokke> yeah :/
<crystal-gh> [crystal] jhass closed pull request #1548: Dismantle CGI module (master...kill-cgi) http://git.io/vnRVF
greengriminal has quit [Quit: Leaving]
<travis-ci> manastech/crystal#9423b4c (master - Merge pull request #1520 from benoist/master): The build passed. https://travis-ci.org/manastech/crystal/builds/81477947
<jokke> what's the primitive type for file descriptors?
<jokke> oh
<jokke> it's just an int
<jhass> yup
<crystal-gh> [crystal] ysbaddaden closed pull request #1523: zlib inflate and deflate IO (master...zlib) http://git.io/vnYAS
<dzv> jokke: use something as as stdin in a subprocess or in the main process?
<jokke> i'm not quite following
<crystal-gh> [crystal] jhass closed pull request #1533: Add .fetch to ENV (master...env_fetch) http://git.io/vnnW7
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vn0zO
<crystal-gh> crystal/master 1ba260a Jonne Haß: Merge pull request #1533 from tristil/env_fetch...
<crystal-gh> crystal/master ed4d498 Joseph Method: Add .fetch to ENV...
<dzv> sorry, use something as stdin in the main program or a subprocess?
<jhass> jokke: could you use STDIN.reopen?
<jokke> hmm
<jokke> jhass: awesome
<jokke> i can
<jokke> very nice!
<jokke> STDIN.reopen(File.open("/dev/tty"))
<travis-ci> manastech/crystal#0e13c35 (master - Merge pull request #1523 from manastech/zlib): The build passed. https://travis-ci.org/manastech/crystal/builds/81484835
<crystal-gh> [crystal] tristil closed pull request #1532: Add Dockerfile.development for quick development (master...development_dockerfile) http://git.io/vnnW1
NeverDie has quit [Quit: http://radiux.io/]
<travis-ci> manastech/crystal#1ba260a (master - Merge pull request #1533 from tristil/env_fetch): The build passed. https://travis-ci.org/manastech/crystal/builds/81486292
NeverDie has joined #crystal-lang
qard has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vn069
<crystal-gh> crystal/master 1d25da5 Ary Borenszweig: Spec: `it` now captures a block. This allow building specs in release mode in a much faster way. Fixes #768
<travis-ci> manastech/crystal#1d25da5 (master - Spec: `it` now captures a block. This allow building specs in release mode in a much faster way. Fixes #768): The build passed. https://travis-ci.org/manastech/crystal/builds/81492135
waj has quit [Remote host closed the connection]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
<Kilo`byte> i didn't even realize crystal made it into the official arch repos xD
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]