ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's 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
greenbigfrog has joined #crystal-lang
tilpner has quit [Ping timeout: 252 seconds]
badeball has quit [Ping timeout: 268 seconds]
badeball has joined #crystal-lang
tilpner has joined #crystal-lang
<FromGitter> <codingphasedotcom> What do you guys think I'm creating a new github project "ROCK" React Over Crystal & Kemal
<FromGitter> <fridgerator> Rock on
<FromGitter> <codingphasedotcom> Thnx
<FromGitter> <codingphasedotcom> Is there any good site or documentation for deploying Crystal app on heroku or digital ocean
<FromGitter> <jwoertink> @codingphasedotcom https://github.com/crystal-lang/heroku-buildpack-crystal/
<FromGitter> <jwoertink> I used this to get a kemal app up on heroku. Super easy
sagax has quit [Read error: Connection reset by peer]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <elorest> @codingphasedotcom I’ve played a bit with Riot.js over Kemal.
<crystal-gh> [crystal] olbat opened pull request #4281: Fix: String#underscore with non-letter char #4278 (master...fix-string-underscore-with-numbers) https://git.io/vSyxY
Qchmqs has joined #crystal-lang
_whitelogger has joined #crystal-lang
mark_66 has joined #crystal-lang
Split has joined #crystal-lang
<FromGitter> <sdogruyol> @codingphasedotcom rocky :D
elia has joined #crystal-lang
zipR4ND has joined #crystal-lang
elia has quit [Ping timeout: 260 seconds]
elia has joined #crystal-lang
<FromGitter> <bew> nice name!
pduncan has quit [Ping timeout: 240 seconds]
pduncan has joined #crystal-lang
gloscombe has joined #crystal-lang
greengriminal has joined #crystal-lang
Qchmqs has quit [Ping timeout: 260 seconds]
<FromGitter> <CodelessFuture> Other then Heroku, where is possible to deploy web app?
<FromGitter> <CodelessFuture> I think any server like Linode and so on, right?
<FromGitter> <sdogruyol> anything
bjz has joined #crystal-lang
gewo has joined #crystal-lang
Split has quit [Read error: Connection reset by peer]
<FromGitter> <bew> when redefining another stdlib for crystal, is there a way to easily change the default `require "something"` path ?
<FromGitter> <bew> and/or add more paths (via env variable maybe) ?
<FromGitter> <luislavena> @bew use `CRYSTAL_PATH` environment variable, a colon-separated list of relative/absolute paths is expected. see `crystal env` for default one.
<FromGitter> <bew> oh perfect, ty!
<FromGitter> <bew> I can't find in the doc, and don't remember where to search, what is the CR equivalent to a C NULL pointer?
Eli_ has joined #crystal-lang
Eli_ has quit [Client Quit]
<FromGitter> <luislavena> That might be covered under C bindings section of the docs? https://crystal-lang.org/docs/syntax_and_semantics/c_bindings/
<FromGitter> <luislavena> There are mention of null for callbacks, but not null pointers under *callback* section
<FromGitter> <bew> I just went through all pages but can't found
<FromGitter> <luislavena> @bew check the `out` documentation, it describes how to pass a null pointer: https://crystal-lang.org/docs/syntax_and_semantics/c_bindings/out.html
bjz_ has joined #crystal-lang
<FromGitter> <bew> thx, finally I figured it out with: `Pointer(Int32).null`
<FromGitter> <bew> or simply `Pointer(Int32).new 0_u64`
bjz has quit [Ping timeout: 240 seconds]
Philpax_ has joined #crystal-lang
<FromGitter> <bew> I have another question tough: with `--prelude=empty` I still can't declare `Array` as a `struct`, it complains with: `Array is not a struct, it's a generic class`, any iea?
<FromGitter> <bew> idea*
<FromGitter> <bew> (I didn't found this error in the compiler sources :/)
Philpax has quit [Ping timeout: 255 seconds]
<FromGitter> <mjago> @bew array is included in prelude so maybe need your own mini prelude?
<FromGitter> <Sija> @bew see `src/compiler/crystal/semantic/top_level_visitor.cr`
<FromGitter> <bew> @mjago I used `--prelude=empty` so no array in this one, @Sija I'll look
<FromGitter> <Sija> IIRC `Array` and some other stdlib classes are defined internally by the compiler but I could be wrong
<FromGitter> <mjago> @bew oh I see - read your question wrong !
<FromGitter> <luislavena> @bew re: NULL pointer, you could have simply used `nil`: https://crystal-lang.org/api/0.21.1/Pointer.html#null-class-method
<FromGitter> <mjago> @Sija @bew yes looks like Array is defined as a class but you can’t instantiate it (without prelude)
<FromGitter> <mjago> sorry I’m wrong - you can do a = Array(Int32).new without prelude
<FromGitter> <bew> yeah and I wonder why... where is it defined?
<FromGitter> <luislavena> @bew `src/compiler/crystal/program.cr`
<FromGitter> <bew> exactly, just found them myself, but ty
<FromGitter> <bew> 2 questions: 1/ What are `MetaVars` ? 2/ If I subclass `Program` and redefine `Program#initialize` I could redeclare all native types ?
<FromGitter> <bew> (2/ ... and make my own compiler, etc..)
Philpax has joined #crystal-lang
Philpax_ has quit [Ping timeout: 245 seconds]
Hates_ has left #crystal-lang [#crystal-lang]
<FromGitter> <eliasjpr> Is there anyway to turn a string into a constant?"
<FromGitter> <eliasjpr> Something like "SomeClass" to SomeClass where I can call SomeClass.new
<FromGitter> <sdogruyol> @eliasjpr you can do that with a macro
<FromGitter> <eliasjpr> okay, I guess I was approaching it the right way, I was wondering if there was a built in macro already
<FromGitter> <eliasjpr> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58ef890e8fcce56b20fb73cf]
<FromGitter> <bew> you can use `klass.id` and `method.id`
<FromGitter> <eliasjpr> Awesome!
<FromGitter> <bew> see the docs for `Crystal::Macros::ASTNode#id` for reference
elia has quit [Quit: (IRC Client: textualapp.com)]
<FromGitter> <bew> in macros, how to get the index of a char in a string literal ? `StringLiteral#index` does not exist..
<FromGitter> <bew> nvm I found a workaround with `StringLiteral#split`
<FromGitter> <eliasjpr> @bew thank reading the docs
jeromegn has quit []
jeromegn has joined #crystal-lang
gewo has quit [Quit: WeeChat 1.5]
<FromGitter> <bew> @eliasjpr just for fun: https://carc.in/#/r/1uvz
gloscombe has quit [Ping timeout: 245 seconds]
gloscombe has joined #crystal-lang
gloscombe has quit [Client Quit]
<FromGitter> <bew> Arch package manager's last crystal version is 20.5 when 21.1 is out :(
<FromGitter> <chuckremes> @eliasjpr I’m starting to collect various metaprogramming tips on the wiki here: https://github.com/crystal-lang/crystal/wiki/MetaProgramming-Help
<FromGitter> <chuckremes> I’m going to add your use-case and the solution that @bew wrote up.
mark_66 has quit [Quit: Leaving.]
<FromGitter> <bew> oh a new wiki page! nice work
<crystal-gh> [crystal] MakeNowJust opened pull request #4283: pp: fixed to return value like 'p' (master...fix/pp/return-value) https://git.io/vSSdQ
<crystal-gh> [crystal] veelenga opened pull request #4284: Refresh zsh completion (master...feature/zsh_completion) https://git.io/vSSdA
aarongodin_ has joined #crystal-lang
fedruantine_ has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #4285: p: not display if no object is given (master...fix/p/empty-display) https://git.io/vSSFM
jokke1 has joined #crystal-lang
bjmllr has quit [*.net *.split]
kragniz has quit [*.net *.split]
fedruantine has quit [*.net *.split]
jokke has quit [*.net *.split]
aarongodin has quit [*.net *.split]
bjmllr has joined #crystal-lang
gloscombe has joined #crystal-lang
aarongodin_ is now known as aarongodin
<FromGitter> <chuckremes> @bew I’ll be putting some work into it the next few days as I figure things out on my end. Really liking crystal but so much of what I do relies on lots of meta-magic. :)
<FromGitter> <bew> ahah! did you see the video (on vimeo iirc) on advanced macros ? I think you should add a link to it in you page as this is very important to not abuse macro (I can search for the link if you want)
<FromGitter> <bew> @chuckremes
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <chuckremes> @bew If you have the link I’d love to see it.
<FromGitter> <bew> https://vimeo.com/190927958
<FromGitter> <bew> here it is ;)
<FromGitter> <chuckremes> Cool. Thank you.
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vSSjW
<crystal-gh> crystal/master b88c28f Vitalii Elenhaupt: Refresh zsh completion (#4284)
gloscombe has quit [Quit: Lost terminal]
greengriminal has joined #crystal-lang
bazaar_ has quit [Ping timeout: 252 seconds]
olbat has quit [Ping timeout: 252 seconds]
minus has quit [Ping timeout: 252 seconds]
bazaar has joined #crystal-lang
olbat has joined #crystal-lang
minus has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
bjz has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
<zipR4ND> hey all
<zipR4ND> a word: how to clone a class with circular dependencies?
<zipR4ND> class Test; @t : Test; end;
A124 has quit [Quit: '']
A124 has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
<FromGitter> <elorest> Is there a way to use `crystal play` with codemirrors vim mode?
<FromGitter> <elorest> how blocks in crystal are different from ruby. despite reading the docs on blocks and procs a few times I don’t really understand the difference between {} and do end. I see that {} work in this case but do end don’t. I would I write my method that takes a block so that do end would work? https://play.crystal-lang.org/#/r/1uya
<FromGitter> <l3kn> seems like the second version is being interpreted as `puts(wrap_in_tags("title", "hello")) do |html| ...`
<FromGitter> <l3kn> I don't think there is anything wrong with your method
ragmaanir has joined #crystal-lang
<FromGitter> <g33kidd> Does crystal support something like this: `something, do: "hello"` ? If not, would it be possible to create a method that does allow this?
<FromGitter> <fridgerator> like a block?
<FromGitter> <fridgerator> https://play.crystal-lang.org/#/r/1uys
<ragmaanir> why does is_a? return an incorrect result here, is it because crystal still has problems with modules/generics? https://carc.in/#/r/1uyb
<FromGitter> <phoffer> @elorest that code will exhibit the same problem in Ruby
<FromGitter> <phoffer> it is being interpreted differently with puts (which can cause funny things in ruby, not sure if crystal shares them)
bjz has joined #crystal-lang
greengriminal has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vifino has quit [Quit: Who turned this off?! D:<]
<BlaXpirit> zipR4ND, maybe you actually just want to use `dup`
<BlaXpirit> clone here would by definition always go into infinite recursion
<BlaXpirit> ragmaanir, looks like a bug to me, pls report
vifino has joined #crystal-lang
<ragmaanir> k
<FromGitter> <elorest> Thanks guys.
<FromGitter> <bew> @elorest see https://play.crystal-lang.org/#/r/1uzs for do/end {/} difference ;)
greengriminal has quit [Quit: Leaving]
LastWhisper____ has quit [Ping timeout: 258 seconds]
greengriminal has joined #crystal-lang
bjz has joined #crystal-lang
ragmaanir has quit [Quit: Leaving]