ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
<FromGitter> <matrixbot> `@Renich:matrix.org` o/
<FromGitter> <matrixbot> `@Renich:matrix.org` https://bugzilla.gnome.org/show_bug.cgi?id=788321
<FromGitter> <matrixbot> `@Renich:matrix.org` Let's see if that works
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite closed pull request #3409: add support to many html entities in HTML.unescape (master...add-support-to-all-html-entities) https://git.io/vPECt
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vd32T
<crystal-gh> crystal/master 3a32c1b Ary Borenszweig: Parser: error on duplicate case when condition
<crystal-gh> crystal/master c82606d Ary Borenszweig: Merge pull request #5036 from asterite/feature/case-when-repeated...
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vd32k
<crystal-gh> crystal/master f6b2942 Ary Borenszweig: Add Int128 and UInt128
<crystal-gh> crystal/master 8514651 Ary Borenszweig: Merge pull request #5024 from asterite/feature/128-bit-integers...
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<travis-ci> crystal-lang/crystal#ee0b844 (master - Merge pull request #5055 from asterite/feature/html-entities): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/281119479
<travis-ci> crystal-lang/crystal#8514651 (master - Merge pull request #5024 from asterite/feature/128-bit-integers): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/281119605
<FromGitter> <bew> Anyone knows where is `Enum#value` defined?
bradleyd has joined #crystal-lang
<bradleyd> 
<bradleyd> exit
<bradleyd> quit
bradleyd has quit [Client Quit]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven is now known as Guest55182
<FromGitter> <ansarizafar> Why I am getting this error ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59cdeff3cfeed2eb65640c17]
<FromGitter> <ansarizafar> Here is my Code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59cdf015b20c6424299ea9df]
Guest55182 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Papierkorb_ has joined #crystal-lang
flaviodesousa has joined #crystal-lang
mark_66 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
ShalokShalom has joined #crystal-lang
saadq has quit [Ping timeout: 240 seconds]
saadq has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
Papierkorb_ has quit [Ping timeout: 240 seconds]
Papierkorb_ has joined #crystal-lang
<Groogy> Morning! o/
<vegai_> howdy!
vegai_ is now known as vegai
Ven has joined #crystal-lang
Ven is now known as Guest7163
<Papierkorb_> Morning \o
rohitpaulk has joined #crystal-lang
<vegai> ansarizafar: seems to me like that sort of usage is not supported
<vegai> Hashes are a bit awkward sometimes in Crystal
<vegai> or I haven't figured them out properly yet
<FromGitter> <bararchy> @ansarizafar just put `@current_user : UserHash` above the declaration, this will tell the class what to expect of it
Guest7163 has quit [Ping timeout: 258 seconds]
rohitpaulk has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest95458
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
Guest95458 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 258 seconds]
<vegai> bararchy: ohh, cool.
<vegai> I tried the exact same on top level, but that didn't work so I assumed the whole doesn't work
<FromGitter> <bew> @bararchy still weird that you need to specify this, as usually, saying `@bla = SomeType.new` will infer to `SomeType`
rohitpaulk has joined #crystal-lang
Ven_ has joined #crystal-lang
Ven_ has quit [Client Quit]
snsei has joined #crystal-lang
pabs has quit [Ping timeout: 248 seconds]
pabs has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest2731
Guest2731 has quit [Ping timeout: 248 seconds]
<FromGitter> <bararchy> @bew I guess that because "property :current_user" practiclly saying that the var might change whenever, if it was a reader only then I guess it wont require the explicit
<FromGitter> <bararchy> this sentance is written really badly , haha, sorry, hope you get what I ment
<FromGitter> <bew> I get it, but I really don't think it's correct
<FromGitter> <bew> There's no difference like that, either the compiler can find the type or it can't, either way it needs to have ot!
<Papierkorb_> bararchy, there being a writer (which is only a normal method like any other) does nothing to type deduction. Type deduction only happens at declaration or definition time, not later.
<FromGitter> <ekremkaraca> Good afternoon guys!
<FromGitter> <sdogruyol> Good afternoon
<FromGitter> <ekremkaraca> Sorry for off-topic but anybody there using fedora?
<FromGitter> <ekremkaraca> Or used before?
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <imonmyown> Good afternoon, I used to use fedora, but that was ages ago
<FromGitter> <bararchy> Papierkorb_ from my logic it was like the spawn ⏎ if you use spawn then it might (when threads arive) change the var in middle of program, so you have to change stuff to be local vars so that it can infer the type ⏎ so I thought that because of the writter + no explicit type declaration, it wont resolve the instance var type as it might change any moment
DTZUZU has joined #crystal-lang
<crystal-gh> [crystal] Sija opened pull request #5058: Support LLVM 5.0 postfixed versions (master...support-llvm-config-5.0) https://git.io/vdsIN
<crystal-gh> [crystal] asterite closed pull request #4727: Add NamedTuple#update(other : NamedTuple) to merge values but keep type (master...named-tuple-update) https://git.io/vQjte
<FromGitter> <ansarizafar> @bararchy @current_user : UserHash not woeking
<FromGitter> <asterite> Please provide a code that compiles. That should work, and I wrote something similar and it works
<FromGitter> <asterite> > undefined method 'public' for WebWare::Roles:Class
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] asterite closed pull request #655: Autodetect triple if the default triple is not compatible with the rootfs (master...20150512-triple-autodetect) https://git.io/vdsqr
<crystal-gh> [crystal] asterite closed pull request #1722: HTTP::Request, added remote ip and peer_addr (master...feature/remote_addr) https://git.io/vdsqH
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #1921: Pass an exception object to `at_exit` block. (master...fix/at_exit_exception) https://git.io/vdsm4
<crystal-gh> [crystal] asterite closed pull request #2180: Openssl updates (master...openssl-updates) https://git.io/vdsmE
<crystal-gh> [crystal] asterite closed pull request #2805: Adds Char#swapcase and String#swapcase instance methods. (master...add-swapcase-to-char-and-string) https://git.io/vonT5
<crystal-gh> [crystal] asterite closed pull request #2883: Remove instance variable error for abstract classes (master...issue_2827) https://git.io/vorXV
<crystal-gh> [crystal] asterite closed pull request #3174: Reimplement NamedTuble#fetch(String) using a Trie (master...patch-7) https://git.io/v6XsN
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite closed pull request #3223: Update Dockerfile to build from Ubuntu 14.04 (master...dockerfile_fix) https://git.io/viIBr
<crystal-gh> [crystal] asterite closed pull request #3459: Add checkbox support to markdown (master...add-checkbox-support-to-markdown) https://git.io/vPbz9
<crystal-gh> [crystal] asterite closed pull request #3554: Added Bernoulli sample (master...feature/bernoulli_sample) https://git.io/vXS3k
<crystal-gh> [crystal] asterite closed pull request #3603: [WIP] Implement Path (master...pathname) https://git.io/v1two
<crystal-gh> [crystal] asterite closed pull request #3686: Adds refered links to Markdown (master...feature/markdown) https://git.io/v1PVL
<crystal-gh> [crystal] asterite closed pull request #3889: [WIP] Not to expend default new for non-class (master...no_default_new_in_module) https://git.io/vMaDo
<crystal-gh> [crystal] asterite closed pull request #3912: Rewrite Channel (master...rewrite-channel) https://git.io/vMi2N
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #4314: Enum: fixed #4269, work fine with private (master...fix/enum/private) https://git.io/vShS4
<crystal-gh> [crystal] asterite closed pull request #4327: Add Array#to_slice and Array#bytesize (master...master) https://git.io/v9T3o
<crystal-gh> [crystal] asterite closed pull request #4349: Add a simple method to run a block every X time (master...feature/every) https://git.io/v9CR6
<crystal-gh> [crystal] asterite closed pull request #4813: Add a macro to `collect` outputs of a yielding method to an array (master...collect) https://git.io/v7Pxa
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb_> "Doesn't belong int std" while there's oauth2 in it sounds like an interesting closing reason
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <sdogruyol> for?
ShalokShalom_ has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> thank you @bew
<FromGitter> <bew> Wow a lot of /old/ PR closed by Ary
<FromGitter> <sdogruyol> he's on a roll :)
<5EXAACNCA> [crystal] mverzilli pushed 1 new commit to master: https://git.io/vds3j
<5EXAACNCA> crystal/master 8c5fb21 TSUYUSATO Kitsune: Remove 1 item Expressions normalization (#4861)...
<07IAA8EAC> [crystal] mverzilli closed pull request #4861: Remove 1 item Expressions normalization (master...fix/crystal/remove-1-expression-normalize) https://git.io/v5ffa
<Papierkorb_> sdogruyol, for a bunch of the closed ones. Clicked on them at random
<FromGitter> <Rinkana> Is there a way that i can continue after a `sleep`? ⏎ ⏎ ```spawn do ⏎ loop do...``` [https://gitter.im/crystal-lang/crystal?at=59ce4587bac826f05413c5df]
<Papierkorb_> Rinkana, there's not. Use a Channel(Nil) instead. Another solution, if you want to exit the process and you put the main fiber to sleep, is to simply use #exit
<FromGitter> <Rinkana> The reason i can't use `Fiber.yield` is because there might be IO events (like `gets`) that will break that loop
<FromGitter> <Rinkana> @Papierkorb_ , ah yeah. That works great!
<travis-ci> crystal-lang/crystal#8c5fb21 (master - Remove 1 item Expressions normalization (#4861)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/281282246
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Philpax has joined #crystal-lang
<FromGitter> <jwaldrip> Whats holding up the YAML revamp? I see its the only thing left in `next`
<FromGitter> <jwaldrip> @asterite
<FromGitter> <crisward> I was impressed last week by the issues being sub 400, pull are now sub 100, give it another month and we can declare crystal is finished! 😉 Good work everyone!
<FromGitter> <asterite> @jwaldrip Someone has to approve it :-P
<FromGitter> <jwaldrip> where is @rx14 when you need him!?
<FromGitter> <jwaldrip> I approve it :-)
<FromGitter> <asterite> Merged!
<FromGitter> <asterite> (just kidding)
<FromGitter> <asterite> I think that PR is huge so it might take some time to review it
<FromGitter> <jwaldrip> ya took me a bit, but I have a ton of context on the issue.
Ven has joined #crystal-lang
<FromGitter> <jwaldrip> may take someone like mr hobbs longer.
<FromGitter> <jwaldrip> Is that the only thing holding up 0.24?
Ven is now known as Guest65998
<FromGitter> <asterite> I don't know, I don't do the releases
<FromGitter> <asterite> Maybe also Time
<FromGitter> <asterite> Ah, that was merged
<FromGitter> <jwaldrip> `Time` or 🕐 ?
<FromGitter> <asterite> So I guess so: https://github.com/crystal-lang/crystal/milestone/22
rohitpaulk has joined #crystal-lang
Guest65998 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bew> I think you can start writing the changelog for the next release, when you'll finish it the last pr will probably be merged 😂
<FromGitter> <bew> (~160 issues/pr to summarize)
<FromGitter> <crisward> Looks like a biggy, did 0.23 have that much going on?
<FromGitter> <crisward> I can already feel a 0.24.1
<FromGitter> <crisward> Also is it going to get compiled again llvm 5?
<FromGitter> <crisward> Wow, even I have a pull request merged in there. Ok, so I just changed some text, but they all count...
<FromGitter> <sdogruyol> everything counts 👍
<FromGitter> <ekremkaraca> @imonmyown Thanks but I failed to build Crystal, then I switched back to Solus
<FromGitter> <jwaldrip> Solus?
<FromGitter> <ekremkaraca> @jwaldrip yet another Linux distribution https://solus-project.com/
ShalokShalom_ is now known as ShalokShalom
<FromGitter> <sdogruyol> I'd suggest using Arch to everyone :P
<FromGitter> <jwaldrip> Gotcha.
<FromGitter> <jwaldrip> Im still on OSX.
<FromGitter> <jwaldrip> I have considered making the switch for years.
<FromGitter> <jwaldrip> Hard to leave the apple ecosystem. Especially when you do iOS development.
<FromGitter> <imonmyown> @ekremkaraca I'm on Ubuntu right now, planning to switch to Arch (as suggested, elsewhere to me personally)
Ven_ has joined #crystal-lang
<FromGitter> <ekremkaraca> I would suggest arch...
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <ekremkaraca> ... but curated and well tested one
<FromGitter> <ekremkaraca> Like manjaro, Solis
<FromGitter> <ekremkaraca> Oops, solus
<FromGitter> <imonmyown> @imonmyown I have an iMac, Apple is addictive, gotta jump off before its too late
rohitpaulk has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
<crystal-gh> [crystal] bcardiff opened pull request #5059: Fix socket initialization (master...fix/socket-initalization) https://git.io/vdsEp
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <jwaldrip> lol
rohitpaulk has joined #crystal-lang
<FromGitter> <ansarizafar> @asterite Even this code is not compiling in playground ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ce5ca5cfeed2eb656685f7]
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
FromGitter has joined #crystal-lang
oprypin has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest32422
Ven_ has quit [Ping timeout: 240 seconds]
<FromGitter> <asterite> Syntax error on line 4
<FromGitter> <asterite> Also the default value should be a String, Int32, Nil or Bool, not another Hash
<FromGitter> <asterite> I think you just want this: ```alias UserHash = Hash(String, (String | Int32 | Nil | Bool)) ⏎ ⏎ class Context ⏎ @current_user = UserHash{"id" => "3534", "role" => "Admin"} ⏎ ... [https://gitter.im/crystal-lang/crystal?at=59ce61477b7d98d30d5083b6]
Papierkorb_ has quit [Quit: Konversation terminated!]
Guest32422 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <ansarizafar> @asterite your code works in playground. I want to use it like that ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ce656e614889d47554f784]
rohitpaulk has quit [Ping timeout: 258 seconds]
<FromGitter> <bew> @ansarizafar works for me... https://carc.in/#/r/2tnx
<FromGitter> <asterite> It works for me. I don't use the playground because playground != crystal
claudiuinberlin has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
DRVTiny has joined #crystal-lang
<DRVTiny> Hello! I am totaly newbie in crystal, but i'm already have a question :)
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> welcome ;)
<FromGitter> <sdogruyol> @DRVTiny welcome
<DRVTiny> Who can tell me: if some functions returns NamedTuple(err: (Error | Nil), result: (JSON::Any | Nil)) - then how can i extract, say, field "description", from the result=func(...) ?
<oprypin> thats some smelly code you're trying to use
<DRVTiny> I try to check whether result[:result].class is JSON::Any and then extract field, but it tells me that Nil cant do []
<oprypin> DRVTiny, to prove this to the compiler u must do it like this if (j = result[:result]) use(j)
<FromGitter> <pawandubey> You can call `not_nil!` on it
<DRVTiny> I need to return from function som structure which contain filled "err" field only if error occured and "result" field only if error not occured. How can i achieve this?
<oprypin> raise err; return result
<oprypin> or at the very least return err or return result depending on the outcome
<DRVTiny> But i dont want to raise anything... That error is not logical error, that is abolutely normal situation. Error means "i cant give you result for some resons, see Error object for more info"
<FromGitter> <bew> don't return a NamedTuple, just return either the Error if there is one, or the result
<oprypin> if something is named Error should not be an exception then i dont know what is
<DRVTiny> And how can i distinguish between error and normal result?
<oprypin> if z.is_a? Error
<oprypin> v
<oprypin> gotta read all of this stuff first
<DRVTiny> Am i right that if class of Error and class of Result is not the same - compiler will not say that Error doesnot support methods of the Result?...
<oprypin> sure
<oprypin> but, see last link
<DRVTiny> OK, thanks...
<FromGitter> <Willamin> instead of returning tuples that way, could you design your object's api to do something like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ce784c7b7d98d30d5115f6]
<oprypin> pls no
<FromGitter> <Willamin> oh is that a bad idea?
<oprypin> it is
<FromGitter> <Willamin> eeeee nevermind then! don't listen to me :D
<FromGitter> <sdogruyol> @Willamin being explicit is a bit more preferred here in Crystal land:P
<oprypin> basically what was already being done but with a full blown meaningless object instead of tuple
<oprypin> DRVTiny, definitely should be an exception though. dont you notice that manual error handling is dragging you down?
<FromGitter> <DRVTiny> Hello, i am DRVTiny... again :)
<FromGitter> <DRVTiny> So... if my things.result is nil, but i am trying to things.result["description"] - it will be compile-time error?
<oprypin> yes
<FromGitter> <DRVTiny> Here is my Error struct: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I want to avoid specifying some message if i get, say, standard HTTP error 404 :) [https://gitter.im/crystal-lang/crystal?at=59ce7bc9b59d55b823528117]
<FromGitter> <DRVTiny> Is it ugly?
<oprypin> yes because it's not an exception
<oprypin> why is code nilable
<FromGitter> <DRVTiny> Because code may absent.
<FromGitter> <DRVTiny> For some src code is useless... For most of them
<oprypin> or you could just use the original http exception instead
<FromGitter> <DRVTiny> code is meaningful if there are no any predeclared associations between code and some "human readable explanation"
DRVTiny has quit [Quit: Page closed]
<FromGitter> <DRVTiny> Oh, finally that works!! ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ce7e56b59d55b823528ecc]
<FromGitter> <DRVTiny> I try to implement ZabbixAPI for Crystal :)
<FromGitter> <DRVTiny> And this is a test, because types in Crystal is difficult for me... for now
<FromGitter> <Melliti> Hello i started crystal and i came from C and C++, this syntax is disappointing me for the moment. So i have a noob question 😃
<FromGitter> <bew> welcome @Melliti !
<FromGitter> <Melliti> for a simple return i have this error message : "can't return from top level"
<FromGitter> <Melliti> Hi Benoit !
<FromGitter> <bew> it means that you can only return from a method/function, not the top level (when you're not in a method/function)
<FromGitter> <bararchy> @Melliti only a function can return a value, you can't retun out of the program
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ce7fd6f7299e8f538a8fdb]
<FromGitter> <Melliti> Ooooooh i copy past from the crystal documentation without seeing i was outside the function thx a lot !
<FromGitter> <Melliti> It's obvious i didn't notice
<FromGitter> <ansarizafar> @asterite If I remove module keyword then the code works in my project. Is this a Crystal bug?
<FromGitter> <bararchy> @Melliti you said the Syntax disappoint you, are there any issues\point in particular you find hard\complex to get around ?
<FromGitter> <asterite> @ansarizafar in the playground I was getting "You've found a bug" with your code, so yes, it's a bug in the playground
mark_66 has quit [Ping timeout: 258 seconds]
<FromGitter> <DRVTiny> Why this does not work? :( ⏎ ⏎ ```ss=s.is_a?(String)?"world":"nothing"``` [https://gitter.im/crystal-lang/crystal?at=59ce83a4b20c642429a22493]
<Papierkorb> "Doesn't work" doesn't work.
<FromGitter> <asterite> because s is undefined
<FromGitter> <bew> 😂
<FromGitter> <bew> add some spaces: `ss = s.is_a?(String) ? "world" : "nothing"`
<FromGitter> <bew> The error was `expecting token ':', not 'nothing'`, which is quite weird
<FromGitter> <bew> @DRVTiny please tell use what doesn't work, it'll be easier to help you out
<FromGitter> <bew> (for next time)
<FromGitter> <asterite> :"nothing" is being parsed as a symbol literal. Use spaces
<FromGitter> <DRVTiny> Spaces, yeah, you write :) I am sorry, in perl that works without spaces, but in Crystal it doesnt. Stupid mistake
<FromGitter> <DRVTiny> s/write/right :)
<FromGitter> <crisward> It's interesting how people coming from different language get syntax issues. Anyone used to writing js see name tuples as object literals, then wonder why they can't update them. The white space sensitivity around colons is interesting as well. Keep meaning on writing an article on syntax for js devs.
<FromGitter> <bew> This formatting feels wrong https://carc.in/#/r/2toa WDYT?
<FromGitter> <bew> (explained in the link)
<FromGitter> <bew> well I can also paste it.. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59ce87ca210ac2692089d119]
<FromGitter> <bew> @crisward good idea!
rohitpaulk has quit [Ping timeout: 240 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <ansarizafar> @asterite Yes. Getting error in playground and when I use crystal run. But If I remove module keyword and use crystal run then the code works.
LastWhisper____ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
sp4rrow has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sp4rrow has quit [Client Quit]
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Client Quit]
<FromGitter> <bew> anyone? (about the "feels weird formatting", see above)
sp4rrow has joined #crystal-lang
rohitpaulk has joined #crystal-lang
sp4rrow has quit [Ping timeout: 240 seconds]
<oprypin> bew, is a bug, what to say. i just think the formatter is a waste of time so i dont feel strongly about it
<FromGitter> <sdogruyol> waste of time?
* Papierkorb grabs popcorn
<FromGitter> <sdogruyol> lol
<oprypin> in the literal, sense, I wish the time devs spent on the formatter was spent on the language itself
<FromGitter> <bew> there are specs that ensure that it formats this way, so there was a decision somewhere to do it this way, this is why I'm asking if you know the reason or not
<oprypin> bew, im pretty sure there was an issue to fix the `1.` example, maybe they didnt get around to `2.`
<FromGitter> <bew> but I partly agree, it's (too?) strong and (a bit?) useless when the lang is not even stable
<oprypin> bew, https://github.com/crystal-lang/crystal/pull/4980 was the issue i mentioned, not sure if it's exactly the same or if it was even merged as part of that other refactor PR
LastWhisper____ has joined #crystal-lang
<FromGitter> <bew> thanks @oprypin! It doesn't seems to be the same, this PR is for def's args, I'm talking about call's args and they aren't handled the same iirc. I'll open an issue about that
<oprypin> ok
<FromGitter> <bew> a *little* issue, won't be too much distraction I hope :)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZU has quit [Quit: WeeChat 1.9]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <HCLarsen> Hi everyone, I'm trying to get Crystal working on a Raspberry Pi, but everything I find online points to instructions that don't work. Has anyone here done this before?
<FromGitter> <HCLarsen> And the link there is the instructions that don't work.
<FromGitter> <HCLarsen> And for some reason, the guy who created those instructions left nothing on his website to ask questions or give feedback.
<FromGitter> <pawandubey> Did you try this thing that was linked there? http://public.portalier.com/raspbian/
<FromGitter> <bew> did you see this http://public.portalier.com/raspbian/
<FromGitter> <bew> ah ^^
<FromGitter> <pawandubey> haha
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <HCLarsen> Yes, as I mentioned, those instructions don't work.
<FromGitter> <bew> what didn't work?
<FromGitter> <HCLarsen> The instructions at http://public.portalier.com/raspbian/
<FromGitter> <bew> I understand, but what error did you got when doing them?
<FromGitter> <HCLarsen> Permission Denied
<FromGitter> <pawandubey> On the first command?
<FromGitter> <pawandubey> You probably need to run it with `sudo` since it is writing to `/etc`
<FromGitter> <HCLarsen> Yes on the first command, and yes, with sudo
<FromGitter> <bew> @pawandubey won't work, as the file will be opened by the non-sudo shell
<FromGitter> <pawandubey> :/
<FromGitter> <bew> try: `echo "deb http://public.portalier.com raspbian/" | sudo tee /etc/apt/sources.list.d/crystal.list`
<FromGitter> <HCLarsen> Might've found a workaround though. I manually created the crystal.list file in that location and entered the necessary data.
<FromGitter> <bew> yeah that works too 👍
<FromGitter> <HCLarsen> Except that running the third instruction now gives an error.
<FromGitter> <HCLarsen> W: GPG error: http://public.portalier.com raspbian/ Release: The following signatures were invalid: BADSIG D5581943005FAF9E Portalier Julien (Debian Packages Sign Key) <julien@portalier.com>
<FromGitter> <pawandubey> I am not a GPG guru but maybe that key has expired
<FromGitter> <HCLarsen> I know very little about GPG, so I'll take your word for it. At least now I have an email address.
<FromGitter> <bew> hmm I think you can: either open an issue and mention @ysbaddaden, or contact him directly to update his key
<FromGitter> <HCLarsen> Open the issue in the crystal repository?
<FromGitter> <bew> I'm not sure, as it's not directly related to the language..
<FromGitter> <HCLarsen> In that case, I'll just directly email him to ask.
<FromGitter> <bew> yeah, and you can mention this too: `echo "deb http://public.portalier.com raspbian/" | sudo tee /etc/apt/sources.list.d/crystal.list` to replace the first line I think
<FromGitter> <HCLarsen> Sure, thanks.
<FromGitter> <HCLarsen> Yeah, just tried that variant, and it does work.
claudiuinberlin has joined #crystal-lang
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vdGYz
<crystal-gh> crystal/master 7e3b642 Sijawusz Pur Rahnama: Add `LibLLVM::IS_50` constant (#5058)
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <georgeu2000> Is there any special reason that Integer overflow does not raise an error?
<FromGitter> <bew> I don't know, maybe because it would be too slow to check everytime there is an operation
<FromGitter> <jose-rodrigues> @bew I dont think it's possible
<Papierkorb> What, overflow checking?
<Papierkorb> That's a core feature of every relevant CPU architecture
<travis-ci> crystal-lang/crystal#7e3b642 (master - Add `LibLLVM::IS_50` constant (#5058)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/281443092
<FromGitter> <bew> yeah but there's not error/warning/anything when it happens in crystal land
<FromGitter> <bew> s/not/no
<FromGitter> <jose-rodrigues> @Papierkorb Are you saying it's possible?
<Papierkorb> What, checking for overflows in theory? Of course it is.
<Papierkorb> Not saying that crystal exposes the primitives directly for it. You can go the C-like route of manually checking it though.
<FromGitter> <jose-rodrigues> How would you check that in C?
<Papierkorb> E.g. `if (a + b < a) { fail(); }`
<Papierkorb> (Note that this triggers undefined behaviour in C, and will not do what you think it does there. The idea should work in Crystal as intended though)
<FromGitter> <jose-rodrigues> Wow. Great @asterite . Thanks for the share.
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <georgeu2000> OK, thanks.
<FromGitter> <georgeu2000> How to add to a tuple?
<Papierkorb> You can't.
<Papierkorb> Use array.
<FromGitter> <georgeu2000> Is there any special reason?
<Papierkorb> Tuples are structures, *not* sequences.
<FromGitter> <georgeu2000> Got it. Thanks.
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
weston1 has joined #crystal-lang
weston1 has quit [Ping timeout: 258 seconds]
snsei has quit [Remote host closed the connection]
<FromGitter> <bew> oh this link is interesting https://github.com/crystal-lang/crystal/pulse#active_discussions
<FromGitter> <bew> to see what needs to finish discussion for example
snsei has joined #crystal-lang
<FromGitter> <jwaldrip> Would you consider Crystal highly opinionated?
<RX14> it's an interesting question
<RX14> we are in some areas and aren't in others I think
<RX14> i'd say we're in the middle
<RX14> a good compromise
weston1 has joined #crystal-lang
weston1 has quit [Ping timeout: 248 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang