ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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
<FromGitter> <paulcsmith> Is there a way to get at the `ENV` from inside a macro? `{{ ENV["something"] }}`. I swear I saw some code that did that, but now I can't seem to find it
<FromGitter> <bew> it's simply `{{ env("something") }}`
<FromGitter> <johnjansen> @paulcsmith take a look over here https://crystal-lang.org/api/0.23.0/Crystal/Macros.html
<FromGitter> <paulcsmith> Perfect! That's it. Thanks @johnjansen
<FromGitter> <johnjansen> we all need a reminder now and again ;-)
<crystal-gh> [crystal] matiasgarciaisaia closed pull request #4667: Statically link stdc++ (master...static-stdc++) https://git.io/vQzeX
hightower2 has quit [Ping timeout: 240 seconds]
tzekid has quit [Quit: Leaving]
nikkkk has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <johnjansen> @papierkorb thanks for the nudge, all read up and things are flying 😄
xiljin has quit [Ping timeout: 240 seconds]
xiljin has joined #crystal-lang
_whitelogger has joined #crystal-lang
isavegas has joined #crystal-lang
<isavegas> Is there an rss feed for the blog?
isavegas has quit [Quit: Page closed]
<FromGitter> <johnjansen> i get the feeling something is a little off with benchmark ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ the second thing seems to be consistently slower than the first … even though its actually the same code [https://gitter.im/crystal-lang/crystal?at=5965918bbc46472974de5c95]
<FromGitter> <johnjansen> in this example ive flipped the order of the `report`s in the benchmark block
<FromGitter> <andrewhamon> I short while ago I asked if anyone knew of any easy to use libs for encrypting messages
<FromGitter> <andrewhamon> I ended up making my own bindings for the libsodium crypto box API https://github.com/andrewhamon/cox
<FromGitter> <andrewhamon> :)
snsei has joined #crystal-lang
pwned has quit [Ping timeout: 240 seconds]
<FromGitter> <fridgerator> 👍
<FromGitter> <codenoid> sup
<FromGitter> <codenoid> can i load a page as a video,,, and the video source from File.open + with .mp4 suffix
_whitelogger has joined #crystal-lang
<FromGitter> <johnjansen> anyone want to guess if these should be equivalent ⏎ ⏎ ```File.symlink?("zones") ⏎ File::Stat.new("zones").symlink?``` [https://gitter.im/crystal-lang/crystal?at=5965b0064bcd78af569f827a]
<FromGitter> <johnjansen> ```File.stat("zones").symlink? # => false```
<bmcginty> johnjansen: Interesting. So stat dereferences? symbolic links with the stat call. Now my brain is getting all stupid and can't figure out if there's some better way to handle this, though if there's a symbolic? call in Stat, the only write thing would be to use lstat there...
<FromGitter> <johnjansen> `lstat` was the answer, although it appears inconsistent
<FromGitter> <johnjansen> i mean lstat is not inconsistent, but all those *should* do the same thing, i would have thought, since they all appear to be equivalent on the surfae
flaviodesousa has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
hightower2 has joined #crystal-lang
<crystal-gh> [crystal] bmmcginty opened pull request #4705: [bugfix] insure proper handling of multiple Content-Length headers in http (master...fix_content_length) https://git.io/vQDpi
<FromGitter> <codenoid> i hate this bug >_< ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5965c0e989aea4761d8d219d]
hightower2 has quit [Ping timeout: 276 seconds]
<FromGitter> <bararchy> What's your music when you program ? :)
<FromGitter> <codenoid> Usually I listen to the proleter, but now i'm not listening any music
snsei has quit []
<FromGitter> <sdogruyol> Hey everyone
<FromGitter> <bararchy> I usually like Opeth , Tool , system of a down for starting projects , and a chill Dubstep or D&B for bugs or complicated work
<FromGitter> <sdogruyol> currently listening https://open.spotify.com/track/4KdfrH2pBQrTEOfZl7RUlj @bararchy
<FromGitter> <jaijszler> hey :D
<FromGitter> <bararchy> @sdogruyol cool :) I'll check it out
<FromGitter> <codenoid> This bug come arriving "when kemal is active, and when it appears, this bug will kill kemal process :(
<FromGitter> <sdogruyol> I used to listen a lot of Opeth, In flames, DT e.g :D
<FromGitter> <sdogruyol> hey @jaijszler
snsei has joined #crystal-lang
<FromGitter> <codenoid> "and i'm in production mode :O " ,, calm down,,, https://www.youtube.com/watch?v=18JQUYgpOlw
<FromGitter> <sdogruyol> @codenoid you're running out of connections in your db pool. Are you sure your DB pool config is proper?
<FromGitter> <codenoid> @sdogruyol How to check it? , Mysql
hightower4 has joined #crystal-lang
<FromGitter> <sdogruyol> you can use MySQLWorkbench to profile and see your connections i guess
<FromGitter> <sdogruyol> I'm not a MySQL user, i prefer Postgres
baweaver is now known as baweaver_away
hightower3 has quit [Ping timeout: 246 seconds]
mark_66 has joined #crystal-lang
<FromGitter> <konovod> @andrewhamon i have monocypher bindings https://github.com/konovod/monocypher but libsodium is perhaps better for general use
<FromGitter> <sdogruyol> haven't used monocypher before
<FromGitter> <sdogruyol> is there any advantages?
<FromGitter> <konovod> Small, no dependencies, it was written to be auditable. One-man project, so fine for my hobby-projects but i'm not sure about using it in "serious business".
<FromGitter> <sdogruyol> oh okay
<FromGitter> <sdogruyol> thanks for the info @konovod
<FromGitter> <sdogruyol> wow a nice blog post about scaling https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b
<FromGitter> <sdogruyol> hope to see Crystal soon :)
<FromGitter> <codenoid> thanks @sdogruyol for suggesting me to use MysqlWorkbench
<FromGitter> <codenoid> i know the bug,,, yasss
<FromGitter> <sdogruyol> you're welcome @codenoid
<Groogy> Morning!
<FromGitter> <sdogruyol> Morning @Groogy
cyberarm has quit [Ping timeout: 260 seconds]
tzekid has joined #crystal-lang
<FromGitter> <sdogruyol> Does anyone know the mods of https://www.reddit.com/r/crystal ?
<oprypin> sdogruyol, why?
<FromGitter> <sdogruyol> It'd be great to have that subreddit for Crystal
<oprypin> i think the situation has been resolved
<FromGitter> <sdogruyol> doesn't it?
<FromGitter> <sdogruyol> what situation?
<oprypin> that subreddit used to be active in parallel
<FromGitter> <sdogruyol> hmm
<oprypin> but mods have been contacted and now it gives a"redirect"
<oprypin> traction picked over short name
<FromGitter> <sdogruyol> I'd prefer having #crystal_lang over #crystal_programming though
<FromGitter> <sdogruyol> or #crystallang
<FromGitter> <sdogruyol> as we also use that tag for twitter e.g
<oprypin> a bit too late
<FromGitter> <sdogruyol> it's like the official hashtag
<FromGitter> <sdogruyol> why, is it too late?
<oprypin> why discard all Reddit posts and subscribers?
<FromGitter> <sdogruyol> I don't want to discard anything here :P
<FromGitter> <crisward> Morning all
<FromGitter> <sdogruyol> morning @crisward
<FromGitter> <umutuluer> @crisward morning
<FromGitter> <crisward> Good to see we now have an almost complete smtp lib - https://github.com/arcage/crystal-email/
<FromGitter> <sdogruyol> yep
<FromGitter> <sdogruyol> actually arcage is using that library for sending out system notifications
<FromGitter> <sdogruyol> kind of battle-tested
Raimondii has joined #crystal-lang
<FromGitter> <sdogruyol> It's in pure Crystal with no dependency, which is awesome
<FromGitter> <crisward> I've got a library the wraps sendgrid and mailgun in a common api. I was going to look at writing an smtp driver for it. I'll probably wrap arcage's lib instead. It's quite nice to have the same api and just be able to swap out the engine (eg nodemailer style)
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <pglombardo> Hi all - I could use some advice/tips. How can I best implement this pattern in Crystal? Where a Student object optionally has a teacher object and I conditionally want to call on that teacher object: https://play.crystal-lang.org/#/r/2cg1
<FromGitter> <pglombardo> I understand *why* it doesn’t work in crystal but not sure how to best write this in Crystal.
<FromGitter> <bew> you need to store the teacher in a variable
<FromGitter> <bew> otherwise the `student.teacher` call could change between the two invocations
<FromGitter> <pglombardo> ah that’s slick - so you bypass the single runtime type of student.teacher
<FromGitter> <pglombardo> Thanks I’ll try that
<FromGitter> <pglombardo> And didn’t realize I left child/father in there - was trying to find the best model to describe the problem of accessing a single optional “parent” or “teacher"
<FromGitter> <sdogruyol> I just used https://github.com/arcage/crystal-email with Gmail to send my first email with Crystal :)
<FromGitter> <bararchy> Nice 👍
<FromGitter> <sdogruyol> It works great and has some great logging
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has quit [Client Quit]
<FromGitter> <bararchy> Work: "We need an interface for vmware VIX so we can control guest and host machines" ⏎ Me: "Ok, what are the lib languge?" ⏎ Work: "C, C#, Perl" ⏎ Me: "Ok.... I'm binding with Crystal to the C lib and will give you a Crystal bin CLI util" ⏎ Work: "Ok" ... [https://gitter.im/crystal-lang/crystal?at=5966012ac101bc4e3a78e8a6]
<FromGitter> <bararchy> Long stroy short, by Work is paying me to create an OpenSource API for VMware machine control in Crystal XD
<FromGitter> <bew> so cooool :D
<FromGitter> <bew> note: in the readme you mis-spelled SDK I think
<FromGitter> <bararchy> XD true
<FromGitter> <bararchy> fixing XD
Philpax has joined #crystal-lang
<FromGitter> <sdogruyol> wow, amazing @bararchy
<FromGitter> <bararchy> If it will be good enough Maybe VMware will consider adding it to the supported lang list :)
<FromGitter> <krypton97> Why is most of the standard lib build on classes? Wasn't better to start with a struct and create different method for that so the heap could be as free as possible?
<Groogy> because structs are copied by value and it wouldn't fit with expected behaviour on some of the structures?
<Groogy> like let's say if arrays and strings were done per value?
<FromGitter> <krypton97> that
<FromGitter> <krypton97> I mean those are 2 cases, but the rest?
<FromGitter> <krypton97> Also allocating on the heap is much slower that the stack and puts pressure on the gc
<FromGitter> <mverzilli> @krypton97 in some cases it might be historical reasons
<FromGitter> <mverzilli> as in "we implemented it and it works, and we never found a bottleneck there, and nobody sent a PR proposing moving it to a struct and explaining why it makes sense"
<FromGitter> <krypton97> sounds legit
go|dfish has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest4446
Guest4446 is now known as Ven``
go|dfish has joined #crystal-lang
Ven`` has quit [Read error: Connection reset by peer]
kubaxvx__ has joined #crystal-lang
tzekid has quit [Ping timeout: 260 seconds]
tatey has quit [Ping timeout: 246 seconds]
adam12 has quit [Ping timeout: 246 seconds]
kubaxvx_ has quit [Read error: Connection reset by peer]
tatey has joined #crystal-lang
adam_ has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <fridgerator> @sdogruyol I just used it yesterday as well! It actually didn't support `AUTH LOGIN` the day before, but @arcage put out a new veresion overnight!
<FromGitter> <fridgerator> I had to send an email through an outlook server from my crystal / kemal app, and without that fix I was going to have to use lambda with node or some other solution
<FromGitter> <sdogruyol> Yeo
<FromGitter> <sdogruyol> Glad to hear that
adam_ is now known as adam12
snsei has quit [Remote host closed the connection]
tzekid has joined #crystal-lang
aidzas has joined #crystal-lang
aidzas has quit [Client Quit]
<FromGitter> <krypton97> hey, any officail-ish authentication in crystal like devise or passport js?
<FromGitter> <alex-lairan> Hi here :) This should work? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596630acf5b3458e303c3f75]
<hightower2> alex-lairan: no, you can't modify tuples/namedtuples after creation.
<hightower2> that's why it is telling you there is no []= method
<hightower2> since you cant say nt[:some]= thing
<FromGitter> <alex-lairan> Okay, how I can make this work? ^^
<Papierkorb> alex-lairan, (named-)tuples are immutable data structures meant to convey context. They're not always that useful for data storage.
<FromGitter> <alex-lairan> Is not hash ruby-like?
<Papierkorb> alex-lairan, you posted a toy example, it doesn't reflect a real use-case
<FromGitter> <hugoabonizio> @alex-lairan what you are looking for is this https://carc.in/#/r/2cgy
<hightower2> alex-lairan: https://play.crystal-lang.org/#/r/2ch1
<Papierkorb> Oh sure there are Hashes, but they're not the right choice for many things
<FromGitter> <hugoabonizio> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5966324276a757f8080299d2]
<FromGitter> <alex-lairan> Oh, name: "Thing" and :name => "Thing" are different in crystal ?
<Papierkorb> alex-lairan, if you have a real use-case, we can help you find a good solution for it
<Papierkorb> Yes they are, first one creates a NamedTuple, latter one a Hash
<FromGitter> <alex-lairan> I don't have use-case, juste a draft
<FromGitter> <alex-lairan> ;)
<FromGitter> <alex-lairan> Thanks for the help
<FromGitter> <codenoid> night,
<FromGitter> <codenoid> is anybody have crystal T-Shirt design ?
<FromGitter> <codenoid> like your shirt @sdogruyol 😆 , it's really cool
<hightower2> Hey, I realize I need to serialize my object in a way that's not per-field. In other words, I want to serialize e.g. @one, @two, @three not as one: ..., two: ..., three: ..., but as a single string like "one/two/three". Does YAML.mapping() have some support for this or I am best of reimplementing to_yaml?
<hightower2> Oh I see, basically if that's what I need, I just need to insert some phony field in YAML.mapping() and define its converter, which in reality will be reading/writing from/to multiple instance vars
<Papierkorb> hightower2: Custom #to_yaml it is - Or, if you insist on having it outside, you can use a Converter module for that from where you're including it in another YAML.mapping()
<hightower2> right
Philpax has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <pglombardo> I can’t find a confirming explanation to this declaration syntax in the docs. What does the `?` indicate? `@message : String? = nil`
<FromGitter> <pglombardo> Is that short hand for `String | Nil`?
hightower2 has quit [Ping timeout: 276 seconds]
<FromGitter> <pglombardo> That’s a nice for brevity if so
<Papierkorb> that's what it is
<RX14> it's weird
<RX14> i think half the contents of the crysatal book is goner
<RX14> type grammar is documented but I can't find it in the sidebar: https://github.com/crystal-lang/crystal-book/blob/master/syntax_and_semantics/type_grammar.md
<RX14> oh nvm i'm blind
<FromGitter> <pglombardo> Doh ok thanks. I was searching for `?` which wasn’t a good start
<RX14> yeah lol
baweaver_away is now known as bawever
bawever is now known as baweaver
snsei has quit [Remote host closed the connection]
fenicks has quit [Ping timeout: 268 seconds]
snsei has joined #crystal-lang
fenicks has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
mark_66 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: 240 seconds]
<crystal-gh> [crystal] mverzilli closed pull request #4494: Print build errors to stderr (master...build-errors-to-stderr) https://git.io/vHRlN
<FromGitter> <sdogruyol> lol
<FromGitter> <renich> Good day, Crystalians!
<FromGitter> <straight-shoota> I've just hacked together a simple Crystal app that serves a Jekyll site dynamically and is about as fast as serving the generated site :D
<FromGitter> <johnjansen> nice work @straight-shoota
<FromGitter> <straight-shoota> thanks. I was just tired of waiting for Jekyll to regenerate :D
<FromGitter> <fridgerator> @straight-shoota thats great, jekyll is soooooo slooooooow
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <renich> @straight-shoota cool, I use Jekyll. What's the name of the app?
<FromGitter> <renich> @hugoabonizio hey man, I got one for ya. Let's say I have 5 schedules running concurrently: A..E. What if I need C to wait for A and B to finish before running and, E needs to wait for C?
xiljin has quit [Ping timeout: 268 seconds]
xiljin has joined #crystal-lang
<travis-ci> crystal-lang/crystal#ffb748f (master - Print build errors to stderr): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/252886782
cyberarm has joined #crystal-lang
<FromGitter> <straight-shoota> @renich No name yet, it's just a poc
<FromGitter> <renich> @straight-shoota oh, OK.
<FromGitter> <johnjansen> @hugoabonizio check out Channel
<FromGitter> <johnjansen> @renich check out Channel
<FromGitter> <renich> @johnjansen hehehe, yep, got the feeling that was meant for me
<FromGitter> <renich> @johnjansen thanks, man. I've read about channel but am scared to try it out.
<FromGitter> <johnjansen> yeah … too many handles on the left side
<FromGitter> <johnjansen> @renich it wont eat your computer … @RX14 ;-)
<FromGitter> <andrewhamon> @konovod nice, I had never heard of monocypher either!
<FromGitter> <renich> @johnjansen will have to do some testing to be able to internalize the knowledge first
<FromGitter> <renich> I was just hopping that there was something implemented in Schedule
<oprypin> renich, seems like it doesn't really fit with the whole interval idea
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<FromGitter> <renich> oprypin: well, yeah. You're right.
<oprypin> also it has no way to reference other tasks
<FromGitter> <johnjansen> @renich schedules aside and focusing solely on synchronization of concurrent tasks https://play.crystal-lang.org/#/r/2ci6
<FromGitter> <renich> wow, thanks, man!
<FromGitter> <hugoabonizio> @renich Hi! I think this kind of synchronization is the perfect task for channels, you should try it, the schedule shard is out of this scope and can be used in parallel with channels
<FromGitter> <renich> @hugoabonizio thanks. I will study @johnjansen 's example and see if I can come up with an implementation later on
<FromGitter> <hugoabonizio> 👍
<FromGitter> <renich> @johnjansen it's pretty clear, man. Basically, you signal completion with ch and ci. Pretty cool.
<oprypin> i've been trying to think about something universal and awesome for that task dependency thing but failed
snsei has joined #crystal-lang
<FromGitter> <sdogruyol> that's an ongoing global problem :P @oprypin
<oprypin> Channel having 0 documentation doesnt help
<FromGitter> <renich> oprypin: https://crystal-lang.org/docs/guides/concurrency.html helps a bit
<oprypin> i know all that
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <drosehn> [earlier] The crystal-vix project looks very interesting.
<FromGitter> <johnjansen> dont google `crystal-vix` in an office environment
<FromGitter> <johnjansen> just an FYI
<oprypin> D:
<FromGitter> <faultyserver> Quick question: I have objects that define `to_json`. How do I use those in a `JSON.build`?
Groogy2 has quit [Quit: WeeChat 1.9]
<FromGitter> <faultyserver> Doing `json.field :thing, object_that_defines_to_json` doesn't work, because the `JSON::Builder` tries to `scalar` only supports a strict set of types
<oprypin> renich, https://carc.in/#/r/2cio @johnjansen
<FromGitter> <drosehn> I just "starred" it here on github, so I can find it later...
<oprypin> faultyserver, i dont know what json.build is but what are you trying to do?
<FromGitter> <faultyserver> Here's the relevant code and error. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596665744bcd78af56a2f115]
<FromGitter> <faultyserver> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5966658ac101bc4e3a7b065d]
<FromGitter> <bew> Nice micro task system oprypin!
<FromGitter> <faultyserver> I'm just trying to build up a JSON object from an array of Runner objects
<oprypin> faultyserver, and why did you choose JSON.build for that?
<FromGitter> <johnjansen> @oprypin ;-) got to love a macro here and there ;-)
<FromGitter> <faultyserver> This is just a minimized example, there's a lot more stuff I'm adding to the generated JSON object
<oprypin> sigh
<FromGitter> <faultyserver> I can get around it, it's just that I would expect that `scalar` would accept an object that defines `to_json`
<oprypin> have you tried `{runner: runner}.to_json`
<FromGitter> <faultyserver> Yeah, that's one workaround that works outside of a JSON.build
<oprypin> ok it appears that with json builder you need to give it only actual scalars of JSON::Type, and it makes sense
<FromGitter> <faultyserver> so how would I get the json representation of an object using `json.field`?
<FromGitter> <fridgerator> I usually end up adding presenter methods in my models
<FromGitter> <faultyserver> I guess I could do that...
<FromGitter> <fridgerator> they take the `json` io as a parameter, and add fields
snsei has joined #crystal-lang
<oprypin> faultyserver, I really don't understand the situation. you are not saying what you want to do, you're saying how one of the possible solution fails
<FromGitter> <faultyserver> Yeah, I'm not really in search of a solution. I've already written a workaround. My question is really just why doesn't `#scalar` accept objects that define `to_json`, but I guess that's more of something that should be written up as an issue.
<oprypin> it does not accept them because it's a pure interface, and nothing prevents you from calling to_json yourself.
<oprypin> here 'pure interface' is not a term, just something i said. it accepts types that can be directly put into json, it's no wonder why magical conversion on the fly is not applied
<FromGitter> <faultyserver> fair enough
<FromGitter> <renich> oprypin: hey ma, awesome example. Thanks. You're definitely the macro wiz :)
<travis-ci> crystal-lang/crystal#ffb748f (master - Print build errors to stderr): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/252886782
<FromGitter> <straight-shoota> @faultyserver This is how it's done: ⏎ ⏎ ``` json.field :runner do ⏎ runner.to_json(json) ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=59666c6df5b3458e303d9335]
<travis-ci> crystal-lang/crystal#ffb748f (master - Print build errors to stderr): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/252886782
<FromGitter> <johnjansen> anyone a regex master ?
<FromGitter> <straight-shoota> Though it would make sense if `JSON::Builder.field` accepted a value that responds to `to_json`
<FromGitter> <straight-shoota> @johnjansen not a master, but might as well give it a try ^^
<FromGitter> <johnjansen> nice :-) so i need to split a string on `\s` yielding blocks as close to `n` chars but no more than `n` … e.g. ⏎ ⏎ ```where n = 16 ⏎ “today is a good day” # => [“today is a good”, “day”]``` [https://gitter.im/crystal-lang/crystal?at=59666db61c8697534a19bfd4]
<FromGitter> <johnjansen> totally off topic of course
<FromGitter> <faultyserver> thanks @straight-shoota, not sure why `field` with a block didn't occur to me :)
<oprypin> johnjansen, just find all `\S{,16}`
<oprypin> wait what, your example does not match what you're saying
<oprypin> cant be done with regex
<FromGitter> <johnjansen> ahhh now thats an answer i can live with
snsei_ has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] straight-shoota opened pull request #4706: Allow `JSON::Builder#field` to accept non-scalar values. (master...jm-json-field) https://git.io/vQSgX
<FromGitter> <renich> How can I do this? ⏎ ⏎ ```n = "3%" ⏎ x = 100 / n.to_f64``` [https://gitter.im/crystal-lang/crystal?at=596677900de4d2545e1f43e0]
<FromGitter> <renich> I mean, I know that `n = 0.03` would give me what I want. I am just curious to see if there's a helper or something
<FromGitter> <johnjansen> nope
<FromGitter> <renich> OK
<FromGitter> <renich> Thanks
greengriminal has joined #crystal-lang
<oprypin> >> "3%".to_f
<DeBot> oprypin: 0x0: ??? at ?? - https://carc.in/#/r/2cjs
<FromGitter> <straight-shoota> @faultyserver #4706
<DeBot> https://github.com/crystal-lang/crystal/pull/4706 (Allow `JSON::Builder#field` to accept non-scalar values.)
<oprypin> thankfully it's not javascript, i was afraid
<FromGitter> <johnjansen> @oprypin loves his macros
<FromGitter> <fridgerator> @straight-shoota 💯
<FromGitter> <domgetter> is it possible to set the type of a property, and if so, is there documentation for it?
<FromGitter> <domgetter> e.g. `class Point; property :x, :y; end`
<oprypin> domgetter, https://crystal-lang.org/api/0.23.0/Object.html#property%28%2Anames%29-macro
<FromGitter> <domgetter> awesome, thank you
hightower2 has joined #crystal-lang
balduin has joined #crystal-lang
snsei has joined #crystal-lang
snsei_ has quit [Read error: Connection reset by peer]
snsei has quit [Remote host closed the connection]
<FromGitter> <ezrast> @johnjansen https://carc.in/#/r/2ckm
<FromGitter> <johnjansen> thanks @ezrast - added to my notepad ;-)
greengriminal has quit [Quit: This computer has gone to sleep]
<oprypin> next challenge (easy mode): find cases when it fails
greengriminal has joined #crystal-lang
<FromGitter> <ezrast> May not do what you want on words longer than sixteen characters
<FromGitter> <johnjansen> haha … that is NOT on my agenda for today
<FromGitter> <johnjansen> yeah, already thought of that @ezrast
<FromGitter> <johnjansen> ;-)
<oprypin> cuts off starts of words
<FromGitter> <ezrast> "undefined behavior"
<oprypin> i would define the very basis for correctness as "the result must include all non-space characters"
<oprypin> that's part of "split a string on `\s`"
<FromGitter> <johnjansen> that would probably be correct
fenicks has quit [Ping timeout: 240 seconds]
p0p0pr37 has quit [Remote host closed the connection]
<FromGitter> <ezrast> Fair enough: https://carc.in/#/r/2cl2
<FromGitter> <splattael> Slightly off-topic: Does anyone knows what happened to @asterite's rufo in GH? https://github.com/asterite/rufo It's 404ing.
<oprypin> wow
fenicks has joined #crystal-lang
<oprypin> i think it's actually deleted
<FromGitter> <splattael> Same with https://twitter.com/asterite 😟
<oprypin> well that's not good
<Papierkorb> My thought on that: `dafuq`
<oprypin> i was gonna say mentions of rufo on twitter deleted. but actually asterite deleted
<FromGitter> <crisward> I think it was mentioned recently that @asterite was stepping down, but no word as to why. He's no longer in the github team.
<FromGitter> <bew> And no word on how much he's stepping down :/
<oprypin> leaving a successor would be nice at least. i'm pretty sad
<FromGitter> <mjago> @mverzilli announced @asterite had left Manas but is still a part of the crystal team (2 days ago on google-groups)
<oprypin> are you sure it's not the other way around?
<FromGitter> <bew> Link please?
<oprypin> no it isnt
<dom96> huh, this is sort of weird.
<dom96> So asterite created Crystal but doesn't own it?
<crystal-gh> [crystal] RX14 opened pull request #4707: Seperate Socket and FileDescriptor IO (master...feature/separate-socket-io) https://git.io/vQSFA
<oprypin> uhm technically that is impossible
hightower2 has quit [Ping timeout: 260 seconds]
<oprypin> no but i don't get it. is there anyone else who properly understands the whole compiler?
<oprypin> because i assume not and that freaks me out
<FromGitter> <johnjansen> anyone want to enlighten me as to WTF this means
<FromGitter> <johnjansen> forget that …
<FromGitter> <johnjansen> the regex was wrong …
<oprypin> johnjansen, wrong in what way?
<FromGitter> <johnjansen> `*`
<FromGitter> <johnjansen> it was a glob, not a regex
<oprypin> okay, but what's the context on that
<FromGitter> <johnjansen> can you see the screen cap in IRC?
<oprypin> oh you just wrote a thing and it turned out as not valid regex
<oprypin> i thought you were taking about earlier splitting
<FromGitter> <johnjansen> ill drop some code … one sec
<FromGitter> <johnjansen> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5966a26176a757f80804d947]
<oprypin> yep. that makes no sense.
<FromGitter> <johnjansen> the `xpr=“*”` in the params is causing an error inside the map
<FromGitter> <johnjansen> my stupid fault
<oprypin> indeed. * is not a regex
<FromGitter> <johnjansen> yup … something to keep in mind ;-)
<oprypin> Crystal has some code to turn a glob into a regex fwiw
<FromGitter> <johnjansen> now that would be a nice find
<oprypin> crazy stuff
<FromGitter> <johnjansen> have you read all the source … you know where everything is
<oprypin> just been looking at all the random stuff people have been asking about, for a long time
baweaver has quit [Excess Flood]
<oprypin> this one was someone looking why glob performed poorly
<oprypin> well here's why
Raimondi has quit [Write error: Broken pipe]
havenwood has quit [Excess Flood]
baweaver has joined #crystal-lang
baweaver has joined #crystal-lang
havenwood has joined #crystal-lang
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
<FromGitter> <johnjansen> well it might provide me with some clues for my `ls + Regex`
<oprypin> johnjansen, why do you want glob as part of ls?
<oprypin> standard ls does not have globbing as far as i understand
<FromGitter> <johnjansen> haha … i dont … that was the mistake
Raimondi has joined #crystal-lang
pleiosaur has quit [Remote host closed the connection]
<oprypin> * expansion is part of the shell
<Papierkorb> It doesn't. Try: `ls \*`
pleiosaur has joined #crystal-lang
Groogy has quit [Remote host closed the connection]
Groogy has joined #crystal-lang
<FromGitter> <johnjansen> this is another one of my, im going to build something and learn all i can about the language under the guise of achieving a real goal i am working on
havenwood has quit [Client Quit]
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
<FromGitter> <elorest> asterite still has his github account but is missing on twitter now. Also he’s still listed on the bountysource page.
<oprypin> scary stuff
<FromGitter> <elorest> Remember when “why the lucky stiff” vanished? Hope this isn’t like that.
<FromGitter> <johnjansen> haha … i have a feeling not too many here will remember that @elorest
<oprypin> wait what
<FromGitter> <johnjansen> see what i mean
<FromGitter> <elorest> A lot of guys here remember the early days of ruby I think...
<oprypin> well not me that's for sure
<FromGitter> <mjago> @elorest that was my first thought - I used to love _why’s blog `sneaking Ruby through the system` or whatever it was 😄
<FromGitter> <elorest> Yeah me too. Back in 2005 I switched to ruby because of his insane book about foxes and ruby.
p0p0pr37 has quit [Remote host closed the connection]
<FromGitter> <mjago> ✨
<FromGitter> <elorest> I guess this was already pointed out but here’s the scariest part: https://github.com/orgs/crystal-lang/people
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
<oprypin> nah he's been hidden from that list for a long time, maybe always
<oprypin> you don't have to be listed to be an owner
<dom96> By own I mean "who has the final say in the development"
<dom96> I'm surprised this is Manas, not asterite.
<dom96> or maybe I'm wrong
<oprypin> dom96, there's no indication that asterite couldn't have the final say if he had a really strong opinion of something
greengriminal has quit [Quit: This computer has gone to sleep]
<oprypin> but also no indication of the opposite... we're kinda in the dark
<FromGitter> <johnjansen> he’s committed recently
<FromGitter> <johnjansen> for what thats worth
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
greengriminal has joined #crystal-lang
tzekid has quit [Quit: Leaving]