jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.14.1 | 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
ragmaanir has quit [Quit: Leaving]
elia has quit [Quit: Computer has gone to sleep.]
marcosdsanchez has quit [Quit: leaving]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Client Quit]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Client Quit]
Philpax has quit [Ping timeout: 260 seconds]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Quit: leaving]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Client Quit]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Client Quit]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Client Quit]
marcosdsanchez has joined #crystal-lang
marcosdsanchez has quit [Client Quit]
marcosdsanchez has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Philpax has joined #crystal-lang
sp4rrow has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
marcosdsanchez has quit [Quit: leaving]
sorbo_ has joined #crystal-lang
sorbo_ has left #crystal-lang [#crystal-lang]
ozra_ has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] marceloboeira opened pull request #2386: Fix typo at time.cr (master...docs-fix) https://git.io/vVkbx
pawnbox has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
sorbo_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
hangyas has joined #crystal-lang
triangles has quit [Quit: Leaving]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
sorbo_ has quit [Remote host closed the connection]
mgarciaisaia has joined #crystal-lang
Renich has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
trapped has joined #crystal-lang
Renich has quit [Quit: leaving]
rok has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 264 seconds]
bjz has joined #crystal-lang
Philpax has quit [Ping timeout: 276 seconds]
elia has joined #crystal-lang
rok has quit [Quit: rok]
sp4rrow has joined #crystal-lang
hangyas has quit [Read error: Connection reset by peer]
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
sp4rrow has quit [Read error: Connection reset by peer]
sp4rrow has joined #crystal-lang
trapped_ has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
trapped has quit [Ping timeout: 260 seconds]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Read error: Connection reset by peer]
sp4rrow has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
alsm has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #2386: Fix typo at time.cr (master...docs-fix) https://git.io/vVkbx
ytti has joined #crystal-lang
trapped_ is now known as trapped
<jokke> RX14: hey
<jokke> RX14: you there?
<RX14> yes
<jokke> cool. I'm trying to debug something regarding crouter. I get the same error message even after your changes in my project that uses crouter. It's really hard to debug, since the message doesn't tell you much...
<RX14> yep, any error in a handler just gets cut off
<travis-ci> crystal-lang/crystal#b4724ac (master - Merge pull request #2386 from marceloboeira/docs-fix): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119211505
<RX14> just comment out lines until it compiles
<RX14> and then you know where the error is
<jokke> ah ok
<jokke> that sucks
<RX14> thats what I did
<RX14> and yeah
<RX14> it's a compil;er bug
<RX14> that it gets cut off
<jokke> mhm
<jokke> k
<RX14> should probably report it
<jokke> it's near impossible to find the bug like this
<RX14> ikr
<RX14> it's a pain
<RX14> seems that syntax errors in proc don't really work
<RX14> or something
<jokke> mmh
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
marcosdsanchez has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVLT8
<crystal-gh> crystal/master fea85c6 Ary Borenszweig: Spec: document `before_each` and `after_each`. Closes #2371 [ci skip]
<crystal-gh> [crystal] asterite closed pull request #2380: Improving Deque#delete (master...improving-deque-delete) https://git.io/vVT8Z
<crystal-gh> [crystal] asterite closed pull request #2367: fixed couple of typos in documentation (master...master) https://git.io/vajND
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVLL7
<crystal-gh> crystal/master b07524c Ary Borenszweig: Merge pull request #2346 from crystal-lang/feature/format_check...
<travis-ci> crystal-lang/crystal#b3c60eb (master - Merge pull request #2367 from vjdhama/master): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119237504
<travis-ci> crystal-lang/crystal#b07524c (master - Merge pull request #2346 from crystal-lang/feature/format_check): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/119240327
ozra_ has joined #crystal-lang
<crystal-gh> [crystal] arktisklada closed pull request #2381: Improving Enumerable#in_groups_of (master...reducing-enumerable-in-groups-of) https://git.io/vVTaG
<marcosdsanchez> /leave
marcosdsanchez has left #crystal-lang [#crystal-lang]
SShrike has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
SShrike has quit [Client Quit]
mgarciaisaia has left #crystal-lang [#crystal-lang]
<BlaXpirit> Is there any way to automatically add return type annotations into my code based on compiler knowledge?
<BlaXpirit> and why aren't they displayed in documentation?
<RX14> aren't they if they are expliciit?
<RX14> doc can't type untyped ones unless they are called because of the nature of the type system
<asterite> BlaXpirit: `def foo(x, y); x.bar(y); end` ... what's the return type? :-)
<BlaXpirit> well in my case more often than not they are static
<asterite> you mean the arguments have type annotations?
<BlaXpirit> def test(a : Bool); a ? 5 : nil; end
<BlaXpirit> so here the return type is surely Int32?
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVL8Q
<crystal-gh> crystal/master 557c400 Ary Borenszweig: Compiler: fixed `protected` methods couldn't be called from a base type into a subclass
<BlaXpirit> and it would still be Int32 even without the Bool annotation, asterite
<BlaXpirit> I suppose this is very difficult
<asterite> BlaXpirit: no, not at all. It can be done
<asterite> the "problem" is that we would need to type all these methods even if they are not used, slowing down compilation times
<RX14> asterite, but it might be worth it for docs generation
<asterite> sure
tony_ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#557c400 (master - Compiler: fixed `protected` methods couldn't be called from a base type into a subclass): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119257427
<BlaXpirit> I really want docs to have this
<BlaXpirit> is there any reasonable way to get the type annotations now?
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVLKZ
<crystal-gh> crystal/master 5ac0ea8 Ary Borenszweig: Compiler: fixed virtual `new` with only one subclass
tony_ has quit [Ping timeout: 268 seconds]
tony_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vVLMI
<crystal-gh> crystal/master c6ad336 Ary Borenszweig: Compiler: uncommented some pending specs that now pass
<crystal-gh> crystal/master 9d91797 Ary Borenszweig: Compiler: fixed `to_s` for `foo(&.bar==(2))`. Fixes #2374
pawnbox has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#9d91797 (master - Compiler: fixed `to_s` for `foo(&.bar==(2))`. Fixes #2374): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119280195
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVLbY
<crystal-gh> crystal/master 11de86c Ary Borenszweig: Compiler: missing clone in RegexLiteral. Fixes #2384
alsm has quit [Ping timeout: 260 seconds]
rok has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVLjR
<crystal-gh> crystal/master 0e23f32 Ary Borenszweig: Compiler: disallow using `typeof` inside `alias` declaration. Fixes #2338
mark2 has joined #crystal-lang
<mark2> Hi guys
<RX14> hi
<mark2> I have this code: url = from_git_config
<mark2> url = Readline.readline("Repository url: ") if url.empty?
<mark2> But I get a compile error for Nil (compile-time type is String?)
<mark2> Actually is generated by an if condition: if url.starts_with?("git")
<RX14> yeah, because there's no starts_with? method on nil
<mark2> repository.cr:22: undefined method 'starts_with?' for Nil (compile-time type is String?)
<RX14> you should be able to use .try
<travis-ci> crystal-lang/crystal#11de86c (master - Compiler: missing clone in RegexLiteral. Fixes #2384): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119291253
<RX14> String? is the same as String | Nil
<mark2> but my first assignment returns a string
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVtvg
<crystal-gh> crystal/master 03e5233 Ary Borenszweig: Added `Pointer#!`. Fixes #2361
<RX14> can you gist your whole code?
<BlaXpirit> RX14, no need
<BlaXpirit> mark2, readline returns String | Nil
<RX14> ohh
<mark2> but why is `url` Nil since from_git_config returns a string
<RX14> url will be String before url = Readline.readline("Repository url: ") if url.empty?
<RX14> and be String? after
<RX14> becayse Readline.readline("Repository url: ") returns String?
<BlaXpirit> url = Readline.readline("Repository url: ") || ""
<BlaXpirit> u can try this
<RX14> s/u/you
<BlaXpirit> if user refuses to press enter, then an empty string will be obtained
<mark2> I got it, it's working with url = Readline.readline("Repository url: ") || "", or if I do a String cast
elia has quit [Quit: Computer has gone to sleep.]
<mark2> I still don't understand why at compile time is checking that assignment because I have the condition "if url.empty?"
<mark2> It should not enter in that method
<RX14> it's not the assingment
<RX14> it's the method call as you said
<RX14> changing the assignment changed the type of `url`
<RX14> which fixes the error
endou_ has joined #crystal-lang
salvor- has joined #crystal-lang
_kfpratt has joined #crystal-lang
bjmllr_ has joined #crystal-lang
miketheman_ has joined #crystal-lang
salvor has quit [Ping timeout: 268 seconds]
iamstef has quit [Ping timeout: 268 seconds]
miketheman has quit [Ping timeout: 268 seconds]
mroth has quit [Ping timeout: 268 seconds]
jwaldrip has quit [Ping timeout: 268 seconds]
endou has quit [Ping timeout: 268 seconds]
bjmllr has quit [Ping timeout: 268 seconds]
kfpratt has quit [Ping timeout: 268 seconds]
rvchangue has quit [Ping timeout: 268 seconds]
tliff has quit [Ping timeout: 268 seconds]
<mark2> I'm a step closer to make it work :) Thanks RX14
rvchangue_ has joined #crystal-lang
steamy is now known as jnylen
tliff has joined #crystal-lang
miketheman_ is now known as miketheman
rvchangue_ is now known as rvchangue
<BlaXpirit> mark2, url.empty? is not a problem, you can ignore all the code that precedes it
<BlaXpirit> Readline.readline() can return String or Nil, that's just it
<BlaXpirit> so code that follows it can't use this return value because it might be Nil
daemonwrangler has quit [Ping timeout: 248 seconds]
<mark2> I ran in another similar issue.
<mark2> Following code:
<mark2> url = "git@github.com:owner/repo-oo.git"
<mark2> match = url.match(/\:(\w+)\/(.*)\.git$/)
<mark2> pp match[1]
<mark2> And I got the error: undefined method '[]' for Nil (compile-time type is Regex::MatchData?)
<RX14> the regex might not match
<RX14> so the math result is nilable
<RX14> match*
<RX14> so you need to nil check it
<RX14> the crystal compiler ENFORCES nil safety
<mark2> It's matching
<BlaXpirit> mark2, have you read the tutorial/documentation?
<BlaXpirit> >> url = "git@github.com:owner/repo-oo.git"; if match = url.match(/\:(\w+)\/(.*)\.git$/); pp match[1]; else; puts ":("; end
<DeBot> BlaXpirit: match[1] = "owner" - more at https://carc.in/#/r/vlw
mroth has joined #crystal-lang
jwaldrip has joined #crystal-lang
<mark2> I read the tutorials and the documentation
<mark2> If I do the following match = url.match(/\:(\w+)\/(.*)\.git$/) as Regex::MatchData
<mark2> I got the expected results match[1] = "owner"
<BlaXpirit> ok
<BlaXpirit> and you'll get a runtime error if it doesn't match, so all is good
<RX14> not really
<RX14> mark2, you don't understand
<RX14> the compiler can't tell whether it matches
<RX14> not at compile time
mgarciaisaia1 has joined #crystal-lang
<RX14> this is a compiled, statically typed langauge
<BlaXpirit> >> url = "git@github.com:owner/repo-oo.git"; match = url.match(/\:(\w+)\/(.*)\.git$/).not_nil!; pp match[1]
<DeBot> BlaXpirit: match[1] = "owner" - more at https://carc.in/#/r/vlx
<BlaXpirit> in this case, same effect as 'as Regex::MatchData'
<RX14> not really
<RX14> with one you get a more relavent error
<mark2> I pretty sure that I need to change my way of thinking, I do ruby at the moment and it's seems a bit strange
<travis-ci> crystal-lang/crystal#0e23f32 (master - Compiler: disallow using `typeof` inside `alias` declaration. Fixes #2338): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119298369
<RX14> have you used a statically typed langauge before, like java?
iamstef has joined #crystal-lang
<mark2> This if first static lang
<RX14> well yes, you'll have to adjust a lot
<mark2> I did some C at university
daemonwrangler has joined #crystal-lang
<RX14> you're trying to prove to the compiler that there is no nil
<RX14> not to yourself
<RX14> and the compiler can't read your mind
<RX14> a regex doesn't always match
<RX14> so you HAVE to handle that case
<RX14> .not_nil! just handles said case by raising an exception
<RX14> but it's usually better to do if match; <whatever>; else; handle error;
<mark2> So the if condition is best (as a codding principle) than a cast?
<BlaXpirit> depending on the language
<mark2> In crystal
<mark2> I want to start with the best practices
<BlaXpirit> if at some point you're 100% sure that it is what you think, then .not_nil! or cast is best. the program will crash if your expectations don't match but it's the easiest way to make it compile
<BlaXpirit> but `if` is applicable more often. http://crystal-lang.org/docs/syntax_and_semantics/if_var.html
<RX14> as BlaXpirit said, they are for different cases
<RX14> when you;re dealing with nil, not_nil! is best
<RX14> if you're dealing with another union, use a cast
<RX14> but if you're less than 100% sure that you know better than the compiler
<RX14> use a if
<RX14> and handle the error
<RX14> not_nil! basically is saying to the compiler that you know better than it
<BlaXpirit> mark2, but also note that this || trick often drastically shortens the code, you use it instead of an `if` if you have a default value you want to use in case it's `nil`
<RX14> yeah, well
<RX14> it's another trick
<mark2> Thanks a lot!! :)
<RX14> || is for providing a default value in case of nil
<RX14> not for handling it by emitting a message or other ways
<RX14> well, not usually
<mark2> In just a few minutes with you I learn quite a few useful tricks, you guys rock!!
<travis-ci> crystal-lang/crystal#03e5233 (master - Added `Pointer#!`. Fixes #2361): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119300238
<asterite> BlaXpirit: I was reading the logs the other day and saw that you had troubles with Path and TypeNode. Please open an issue to discuss these things, they are important and interesting :-)
<asterite> One idea I had is that if a method can't be found in a Path node, then it can try to see if it denotes a type and then forward the method to it (as a TypeNode)
donpdonp has joined #crystal-lang
<donpdonp> given person = { name: "bob", age: 20 }, if I use person[:age], it has a mixed type of (Int32 | String). Can I cast it/force the type somehow
<donpdonp> Math.min(person[:age], 10) => Error: instantiating 'Math:Module#min((Int32 | String), Int32)'
<RX14> no, you'll haveto cast
<RX14> you probably want a record or class
<donpdonp> How would I do that?
<RX14> instead of a hash
<RX14> or a tuple
<donpdonp> hmm
<donpdonp> okay
<RX14> but the tuples are indexed by number
<RX14> yeah use the record macro
<BlaXpirit> (which creates a struct in case it wasn't clear)
<BlaXpirit> asterite, would be awesome
<RX14> >> record Person, name : String, age : UInt16; person = Person.new("test", 20); person.to_s
<DeBot> RX14: no overload matches 'Person#initialize' with types String, Int32 - https://carc.in/#/r/vlz
<BlaXpirit> though may confuse some people hopelessly
<donpdonp> are there docs for the record macro? im glancing through /docs
<asterite> BlaXpirit: I'll open an issue to discuss that. I might even try to implement it and see the consequences
mgarciaisaia1 has left #crystal-lang [#crystal-lang]
<RX14> >> record Person, name : String, age : UInt16; person = Person.new(); person.to_s
<DeBot> RX14: wrong number of arguments for 'Person#initialize' (given 0, expected 2) - https://carc.in/#/r/vm0
<RX14> oh
<RX14> >> record Person, name : String, age : UInt16; person = Person.new("test", 20_u16); person.to_s
<BlaXpirit> age: uint16 ? wut
<DeBot> RX14: # => "Person(@name=\"test\", @age=20)" - https://carc.in/#/r/vm1
<asterite> BlaXpirit: yes, the confusion is the downside. Alternatively we can have something like `resolve(...)` that will resolve a path to its type. But then you will have to invoke this in every macro "just in case" (I'll explain more in the issue)
<RX14> donpdonp, http://crystal-lang.org/api/toplevel.html#record%28name%2C%2Aproperties%29-macro
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVt3G
<crystal-gh> crystal/master a1264fd Ary Borenszweig: Fixed #2385: List of overloads for static/class methods is duplicated for generic classes
<donpdonp> RX14: +1
<RX14> you just need to have used the crystal docs to know where to look :3
mark2 has quit [Read error: Connection reset by peer]
rolha has joined #crystal-lang
marcosdsanchez has joined #crystal-lang
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vVtcP
<crystal-gh> crystal/master 6b51033 Brian J. Cardiff: Playground: instrument values using blocks to catch exceptions per line. fix #2369.
dsounded has joined #crystal-lang
<dsounded> If module has another module which has same name as a high level class, can I call class with prefix :: as in Ruby ?
<BlaXpirit> dsounded, prefix :: means toplevel
<dsounded> so if Module::Name I can call ::Name to call class Name not module one ?
<BlaXpirit> yes, dsounded
<BlaXpirit> >> module Test; class Array; end; def test; ::Array.new; end; end; Test.test
<DeBot> BlaXpirit: undefined method 'test' for Test:Module - https://carc.in/#/r/vm7
<BlaXpirit> >> module Test; extend self; class Array; end; def test; ::Array.new; end; end; Test.test
<DeBot> BlaXpirit: instantiating 'Array(T):Class#new()' - https://carc.in/#/r/vm8
<BlaXpirit> sigh what a bad example
<BlaXpirit> >> module Test; extend self; class Time; end; def test; ::Time.new; end; end; Test.test
<DeBot> BlaXpirit: # => 2016-03-29 18:12:19 +0000 - https://carc.in/#/r/vma
<BlaXpirit> there we go, dsounded
dsounded has quit [Quit: Page closed]
<travis-ci> crystal-lang/crystal#a1264fd (master - Fixed #2385: List of overloads for static/class methods is duplicated for generic classes): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119312361
rok has quit [Quit: rok]
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<travis-ci> bcardiff/crystal#a1264fd (master - Fixed #2385: List of overloads for static/class methods is duplicated for generic classes): The build passed. https://travis-ci.org/bcardiff/crystal/builds/119316517
<donpdonp> why isnt #dup, dup'ing?
marcosdsanchez has left #crystal-lang [#crystal-lang]
<travis-ci> crystal-lang/crystal#6b51033 (master - Playground: instrument values using blocks to catch exceptions per line. fix #2369.): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119317854
<RX14> donpdonp, huh
<RX14> donpdonp, oh
<RX14> you have to override bup
<RX14> dup*
<donpdonp> ohh
<donpdonp> hahaha. ok
<crystal-gh> [crystal] bcardiff closed pull request #2356: Playground: add workbook support (master...workbook) https://git.io/va56Y
<RX14> donpdonp, ^
<RX14> also greatly simplifies your exampls
<donpdonp> ah property, i knew there had to be a way
<RX14> shows use of the property macro and syntax for setting class variables in the ctor
ozra_ is now known as ozra
<RX14> you can also do `property a : String` to comfile the type
<donpdonp> nod. the more typing the merrier.
<RX14> you mean less
splattael has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVtaY
<crystal-gh> crystal/master e1841b2 Ary Borenszweig: Fixed #2194: preserve special variables in the whole method, even if "declared" inside a block
rolha has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#ac310c8 (master - Merge pull request #2356 from will/workbook): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119328401
mgarciaisaia has joined #crystal-lang
<travis-ci> crystal-lang/crystal#e1841b2 (master - Fixed #2194: preserve special variables in the whole method, even if "declared" inside a block): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119331531
mgarciaisaia has quit [Quit: Leaving.]
luislavena has joined #crystal-lang
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vVtyn
<crystal-gh> crystal/master 20cfb75 Brian J. Cardiff: Playground: collect macro names in playground source and avoid instrumenting them. fix #2355
x0f has joined #crystal-lang
Ven has joined #crystal-lang
<donpdonp> I just want to say 1,000,000 thanks for https://github.com/crystal-lang/sublime-crystal
<donpdonp> its very good at formatting my crystal
<donpdonp> compiler feedback in-editor is amaze, too.
<RX14> still prefer vim-crystal :3
<BlaXpirit> i'm looking for a clever way to turn CamelCase into snake_case in a macrto
<RX14> gsub?
<BlaXpirit> in a macro?
<RX14> it works
<RX14> >> {% puts "aaa".gsub(/a/, "b") %}
<DeBot> RX14: "bbb" - more at https://carc.in/#/r/vmm
<RX14> BlaXpirit, ^
<BlaXpirit> crazy
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVtHq
<crystal-gh> crystal/master ca3ab80 Ary Borenszweig: Fixed #2353: unable to use non-Int32 number as type argument
<BlaXpirit> RX14, that's nice but the block version doesnt work
<RX14> yeah ofc
<RX14> why do you need the block version?
<BlaXpirit> to turn CamelCase into snake_case in a macro
<BlaXpirit> .lower
<RX14> why not do it with a normal regex
<BlaXpirit> what kind of regex has .lower
<RX14> uhh thats a point
<RX14> BlaXpirit,
<RX14> >> {% puts "TestThing".underscore %}
<DeBot> RX14: "test_thing" - more at https://carc.in/#/r/vmn
<RX14> stdlib man
<BlaXpirit> holy smokes
<RX14> CHECK THE DOCS
<RX14> pls
<BlaXpirit> what docs, there are no macro docs
<RX14> kek
<RX14> liar
<BlaXpirit> well i'll be damned
<RX14> pls
<BlaXpirit> thanks
marcosdsanchez has joined #crystal-lang
rolha has quit [Remote host closed the connection]
rolha has joined #crystal-lang
trapped_ has joined #crystal-lang
Raimondii has joined #crystal-lang
trapped has quit [Ping timeout: 244 seconds]
Raimondi has quit [Ping timeout: 244 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vVtFV
<crystal-gh> crystal/master a83c8dc Ary Borenszweig: Forward `===` method when comparing against JSON::Any or YAML::Any
<travis-ci> crystal-lang/crystal#20cfb75 (master - Playground: collect macro names in playground source and avoid instrumenting them. fix #2355): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119347476
tony_ has quit [Ping timeout: 240 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tony_ has joined #crystal-lang
Ven has joined #crystal-lang
<travis-ci> crystal-lang/crystal#ca3ab80 (master - Fixed #2353: unable to use non-Int32 number as type argument): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119352226
marcosdsanchez has left #crystal-lang [#crystal-lang]
marcosdsanchez has joined #crystal-lang
Rinkana has joined #crystal-lang
Rinkana has quit [Client Quit]
edjsu has quit [Quit: WeeChat 1.2]
ozra has quit [Read error: Connection reset by peer]
elia has joined #crystal-lang
ozra has joined #crystal-lang
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
trapped_ is now known as trappoed
trappoed is now known as trapped
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
rolha has joined #crystal-lang
bcardiff has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bcardiff> @emancu_ tools are just normal crystal apps. Depending on your need you will depend on crystal parser / compiler. For Crystal 0.11.1 I publish https://github.com/bcardiff/crystal-tool-demo , yet with the new `crystal env` option it could be done better.
<bcardiff> if your tool needs to actualy build the source you will require a CRYSTAL_PATH setup when running the tool (or the binary will have hardcoded some of your path). This goes deep in the ./bin/crystal bash file.
<travis-ci> crystal-lang/crystal#a83c8dc (master - Forward `===` method when comparing against JSON::Any or YAML::Any): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119360867
sp4rrow has joined #crystal-lang
edjsu has joined #crystal-lang
<crystal-gh> [crystal] bcardiff pushed 2 new commits to master: https://git.io/vVqOn
<crystal-gh> crystal/master ec7a376 Brian J. Cardiff: Playground: trap compiler bug exception in playground and avoid shutting down the server
<crystal-gh> crystal/master 7c96ff7 Brian J. Cardiff: Playground: instrument UnaryExpression, BinaryOp, IsA, ReadInstanceVar expressions
bcardiff has quit [Quit: bcardiff]
marcosdsanchez has quit [Quit: leaving]
donpdonp has left #crystal-lang ["WeeChat 1.4"]
bcardiff has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
dome22xl has joined #crystal-lang
<dome22xl> I had a good play with macros today https://carc.in/#/r/vli
<dome22xl> So far i like however i discovered over the weekend they are evil with scoping
Philpax has joined #crystal-lang
rolha has quit [Quit: Textual IRC Client: www.textualapp.com]
<RX14> how so?
<dome22xl> I think its more todo with macro abuse on a project i was hacking on pretty hard to read however
<dome22xl> i got quite interested in the macro coding and how it works
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vVqcz
<crystal-gh> crystal/master 9864c98 Brian J. Cardiff: Playground: minor style adjustment. h1...h4 and ul li for better markdown look and feel in workbook.
<RX14>
trapped has quit [Read error: Connection reset by peer]
ytti has quit [*.net *.split]
mverzilli has joined #crystal-lang
<travis-ci> crystal-lang/crystal#9864c98 (master - Playground: minor style adjustment. h1...h4 and ul li for better markdown look and feel in workbook.): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/119391863
mverzilli has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
tony_ has quit [Ping timeout: 260 seconds]
splattael has quit [Quit: Connection closed for inactivity]
bcardiff has quit [Quit: bcardiff]
dome22xl has quit [Read error: Connection reset by peer]
thelonelyghost has joined #crystal-lang