ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | 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
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sz0 has quit [Quit: Connection closed for inactivity]
simen has joined #crystal-lang
<simen> Can anyone help me make sense of a nonsensical type error?
<simen> this definition: https://gist.github.com/anonymous/26b4a58c6f9467494f23913811330510 (snipped from a larger file) fails with the error "type must be Pointer(LispObject), not Pointer(LispObject)"
simen has quit [Quit: Page closed]
hako has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <fridgerator> Is there an easy way to `JSON#parse` and return a `Hash(String, String)` ?
_whitelogger has joined #crystal-lang
<FromGitter> <fridgerator> if I know all the types are String?
<FromGitter> <akzhan> JSON::parse().as_h returns Hash(String, JSON::Any)
<FromGitter> <fridgerator> I was hoping there was a shortcut other than iterating the keys and making a new hash
<FromGitter> <akzhan> Try Hash(String, String).from_json(…)
<FromGitter> <akzhan> https://crystal-lang.org/api/0.18.7/Object.html#from_json%28string_or_io%29%3Aself-class-method
<FromGitter> <fridgerator> oooh, i'll try that
<FromGitter> <fridgerator> yep, I think that will work
<FromGitter> <fridgerator> thanks @akzhan
balduin has joined #crystal-lang
dostoyev1ky is now known as dostoyesvky
Disrecollection has joined #crystal-lang
<Disrecollection> Howdy, I'm a neophye programmer who's messed with C, C++, and Ruby before, and one of my mentors mentioned Crystal as a cool OS. Right now, I'm messing around with Crystal and making some basic programs, but it's hard to find any documentation aimed at a newb like me that assumes the reader is a complete idiot, so I feel I may be missing some pretty basic/core concepts
<Disrecollection> Additionally, I'm not too familiar with IRC, but I seem to be connected to the chat via Pidgin
rohitpaulk has joined #crystal-lang
<FromGitter> <drosehn> I think crystal is missing the kind of documentation that you would want to see. It could be used as an introductory language, but someone needs to take the time to write a book which is really designed to help at that level.
<FromGitter> <drosehn> If you catch the chat at the right time, you can probably find people who will help you through some of the tasks, even if it's just a matter of pointing you to the right place in the existing documentation. But it's 1:30am where I am right now, so I'm heading to sleep. :smile:
rohitpaulk has quit [Ping timeout: 260 seconds]
<Disrecollection> Wow, I am tired. Lang*
<FromGitter> <drosehn> Heh. yeah, it's a language, not an OS!
<Disrecollection> I guess I'll try to catch a busier time, ask some questions then.
<Disrecollection> Thanks for the help.
<FromGitter> <drosehn> you're welcome. good luck with your experimenting!
rohitpaulk has joined #crystal-lang
yogg-saron has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
martinium has joined #crystal-lang
balduin has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
martinium has quit [Quit: WeeChat 1.7]
<FromGitter> <bararchy> btw, Disrecollection , you can connect to gitter instead of IRC if you want
<Disrecollection> I had an idea of what IRC is, I literally have never heard of gitter.
<Disrecollection> I assume it's some sort of git-based im thing?
<FromGitter> <bararchy> Yeha XD
<FromGitter> <bararchy> it's much more UI
<FromGitter> <bararchy> ahh
<FromGitter> <bararchy> lol
<FromGitter> <bararchy> It's much more UI friendly
<FromGitter> <bararchy> and it's just going to some site using the browser
<FromGitter> <bararchy> btw, what specific questions do you have ?
<Disrecollection> Yeah I found it.
<Disrecollection> Oh!, I'm working on a web scraper with crysagiri and files and such and I'm quite lost. I think the method/everything is an object perspective is messing with my head. It's been a while since I even touched ruby
<FromGitter> <bararchy> Do you work on Github ? can you share the code ? what exactly is giving you issues ?
duckqlz has joined #crystal-lang
<Disrecollection> Yeah I've a github set up. Gimmie a couple mintues to finish transferring some psuedo over from paper and I'll link up a public repo
<FromGitter> <bararchy> :+1:
cyberarm has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
cyberarm has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> We need something like that for Crystal XD https://fossbytes.com/wp-content/uploads/2015/09/python-3-in-one-pic.png
<Disrecollection> Almost got it, just doing the git stuff now.
<FromGitter> <bararchy> why ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=593658ef6462d8493ce4b3be]
mark_66 has joined #crystal-lang
<Disrecollection> I don't actually know. I guess I wanted a singular instance of the omniHTML class with the ability both to parse the html, and to create/edit files. Why, does Crystagiri::HTML have that functionality already and I missed it?
<Disrecollection> I feel like I'm not grasping the core concepts of how methods work, but I clearly remember no problems when I was coding in Ruby 6 or so months back.
Raimondii has joined #crystal-lang
<FromGitter> <bararchy> I just mean, you could do that, but, I would create a method ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=59365ae87503e2b70615b328]
<FromGitter> <bararchy> or something
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <bararchy> then just call `create_and_dir` instead of polluting your class whith uneeded functionallity
<FromGitter> <bararchy> if all you need is mkdir and cd
<FromGitter> <bararchy> this way we can also create a `mark_and_retreat` method to take Dir.current, and cd back to it after it created all needed subdirs
<Disrecollection> Yeah, that seems a lot better.
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
<Disrecollection> Alright, I've been working with Crystal for 11 hours, and I think that's enough time. I think that at this point my returns have diminished to the point where it would just be better for me to get some sleep. I will return, and hopefully I will not be so much of an idiot when I do.
Disrecollection has quit [Quit: Leaving.]
<FromGitter> <bararchy> LOL, good night, I think it would be better for you to take a quick refresh on Ruby, the structure is really similar and it has more reading material
<FromGitter> <bararchy> and we are here if you need anything else :)
<FromGitter> <bew> simen you have a nice type error ^^, as a workaround, I'd say, you don't need to specify the return type, you can simply omit it, the error should go away
<FromGitter> <bew> I cannot reproduce your error with the code you linked
Kug3lis has joined #crystal-lang
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
Philpax_ has joined #crystal-lang
Kug3lis has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite closed pull request #4517: Format multi-line braces blocks using do/end (master...feature/formatter-do/end) https://git.io/vHVfi
<travis-ci> crystal-lang/crystal#abd2dfd (master - Apply formatter changes from previous commit): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/239914681
<FromGitter> <l3kn> I'm trying to build a linear algebra library for crystal and want to make sure that the class used inside vectors (and matrices etc) is a field ⏎ (=> provides methods Class.zero, Class.one, + and *). ⏎ ⏎ The number classes (IntN, FloatN) already have all of these besides `Class.one`, ⏎ is there a better way than monkey-patching these inside my library? (example: https://play.crystal-lang.org/#/r/2531)
<Yxhuvud> I don't think there is a better option for you if you want to persue that path to an abstract algebra package. Have you seen crystalla? it is a bit less abstract but provides some bindings to LAPACK
<FromGitter> <l3kn> Yxhuxud: Thanks for the hint! I'll try to come up with some code and benchmark it against that. ⏎ I guess (at least for simple operations with small vectors & matrices) using structs instead of classes (like they do) would be a lot faster
<FromGitter> <bararchy> it would be cool to have `crystal spec` handle each file as a different process or Thread , as to run them concurrentlyl
<FromGitter> <bararchy> or have --process 5 , etc.. to run 5 specs at a time
Kug3lis_ has joined #crystal-lang
Kug3lis has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] bmulvihill opened pull request #4521: Fix Formatter ::Tuple(T) (master...formatter-tuple-bug) https://git.io/vHr8W
yogg-saron has joined #crystal-lang
rohitpaulk has joined #crystal-lang
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bararchy> What's the best way to strip non ascii chars from a String ?
<FromGitter> <bew> `"abc→d".delete { |c| !c.ascii? }`
<FromGitter> <bararchy> Ohhhh cool !
<FromGitter> <bew> :)
<FromGitter> <bararchy> @bew it seems it wont take out special signs
<FromGitter> <bararchy> Maybe ASCII is less relevant , only alphabet chars
<Yxhuvud> would you want it to remove nonascii alphabet chars?
<FromGitter> <bararchy> No, just want to remove anything which is not alphabet
<FromGitter> <bararchy> special signs , numbers, etc..
<FromGitter> <l3kn> `string.delete("^a-zA-Z")`
<FromGitter> <l3kn> or using the same code as before, but with `!c.ascii_letter?`
<FromGitter> <bararchy> does delete accept Regex ? and if so it should be `/^a-zA-Z/` no ? ⏎ ⏎ Also, can't find `ascii_letter?` in the API
<FromGitter> <bew> yep this is missing...
<FromGitter> <bararchy> even though it seems to work haha
<FromGitter> <l3kn> https://crystal-lang.org/api/0.21.0/Char.html#ascii_letter%3F-instance-method
<FromGitter> <bararchy> Oh, it's for char
<FromGitter> <bararchy> Thanks @l3kn
<FromGitter> <bew> oh thanks I missed it
<FromGitter> <l3kn> The delete range stuff is a little bit strange, it seems to be jus a subset of regexes (ranges & negation) https://crystal-lang.org/api/0.21.0/Char.html#in_set%3F%28%2Asets%3AString%29-instance-method
<FromGitter> <l3kn> *just
<FromGitter> <bew> yes, it's manually implemented (look at the sources)
<FromGitter> <bew> using `in_set?`: `"a#~D".delete { |c| !c.in_set?("a-z") && !c.in_set?("A-Z") }` cannot get it shorter
<FromGitter> <bew> but I think using `Char#ascii_letter?` is way faster
<FromGitter> <bararchy> Yeha , working :) ⏎ Now my BagOfWords shows that the word: jerusalem repeats 1020.0 times in the bible hahahaha
<FromGitter> <bararchy> and not jerusalem; 50 ⏎ jerusalem%4. 20 ⏎ ⏎ etc.. [https://gitter.im/crystal-lang/crystal?at=5936a9aaf31c8ced0c0b3d44]
<FromGitter> <bararchy> haha
<FromGitter> <bew> nice :p
<crystal-gh> [crystal] bew opened pull request #4522: Fix typos in lexer (master...lexer-typos) https://git.io/vHr2P
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
Philpax_ has quit [Ping timeout: 246 seconds]
Kug3lis_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
greengriminal has joined #crystal-lang
balduin has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Renich has joined #crystal-lang
balduin has quit [Remote host closed the connection]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
Renich has quit [Ping timeout: 246 seconds]
greengriminal has quit [Quit: Leaving]
Renich has joined #crystal-lang
<FromGitter> <bew> someone knows why travis fails here? https://travis-ci.org/crystal-lang/crystal/jobs/240012478
<FromGitter> <bcardiff> @bew restarted. it fails because of a time out when downloading llvm in osx, it switch to building llvm, which travis is no capable due to some limitation AFAIK
Renich has quit [Ping timeout: 268 seconds]
Renich has joined #crystal-lang
bmcginty has quit [Ping timeout: 255 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
greengriminal has joined #crystal-lang
<FromGitter> <akzhan> it’s error by travis ci itself. sometimes it doesn't download required resources and fails the build.
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
LastWhisper____ has joined #crystal-lang
<FromGitter> <eliasjpr> Is it possible to use ENV crystal YAML files?
<FromGitter> <eliasjpr> I mean something like ⏎ ⏎ ```digitalocean: ⏎ token: <%= ENV[“token”] %>``` [https://gitter.im/crystal-lang/crystal?at=5937047d167d046a7d74f60e]
Philpax_ has joined #crystal-lang
<FromGitter> <bew> @bcardiff thanks!
p0p0pr37 has quit [Ping timeout: 268 seconds]
greengriminal has quit [Quit: Leaving]
<FromGitter> <fridgerator> I'm having issues installing crystal on ubuntu through aptitude, something about public key not being available and `The repository 'https://dist.crystal-lang.org/apt crystal InRelease' is not signed`
<FromGitter> <fridgerator> oh the keyserver is failing again, ugh
<FromGitter> <fridgerator> seems like every time I try and use `keys.gnupg.net` I have to fiddle with it, anyone else have this problem?
greengriminal has joined #crystal-lang
greengriminal has quit [Ping timeout: 260 seconds]
<FromGitter> <bararchy> Use keyserver.ubuntu.com
<FromGitter> <fridgerator> ty
kellabyte has left #crystal-lang [#crystal-lang]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Renich has quit [Quit: Renich]
<crystal-gh> [crystal] asterite closed pull request #4521: Fix Formatter ::Tuple(T) (master...formatter-tuple-bug) https://git.io/vHr8W
<18VABCKZR> [crystal] asterite pushed 1 new commit to master: https://git.io/vHo1Z
<18VABCKZR> crystal/master 739fc81 Bryan Mulvihill: Write :: before formatting
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vHo1n
<crystal-gh> crystal/master 1f2200d Ary Borenszweig: Fixed #4520: "Invalid memory access" in tuple members in Crystal 0.22
LastWhisper____ has joined #crystal-lang
<FromGitter> <straight-shoota> I need to create an iterator from a range with either positive or negative steps, where start, stop, step are dependent on input. The problem: `Range#step` does not work with negative steps `Range.new(10, 5).step(-1)` is just empty. There is also `Number#step` but this seems to not support exclusive range. Am I missing something?
<FromGitter> <l3kn> wouldn't subtracting step from to make it exclusive?
<oprypin> backwards iterator is entirely separate
<FromGitter> <straight-shoota> `Number::StepIterator` goes both directions: https://github.com/crystal-lang/crystal/blob/20655484b34a35ed1e69c8cad0525df8fac22323/src/number.cr#L243
<FromGitter> <straight-shoota> Just exclusiveness missing...
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
<travis-ci> crystal-lang/crystal#739fc81 (master - Write :: before formatting): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/240147911
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#1f2200d (master - Fixed #4520: "Invalid memory access" in tuple members in Crystal 0.22): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/240147953
<DeBot> https://github.com/crystal-lang/crystal/issues/4520 ("Invalid memory access" in tuple members in Crystal 0.22)
<FromGitter> <eliasjpr> github is down :cry:
<FromGitter> <elorest> Is there a crystal like sshkit thing?