<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
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 #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 #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
<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!
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> 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?
<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?...
<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.
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> 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> 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.
<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)