pawnbox has quit [Remote host closed the connection]
<BlaXpirit>
wow
<FromGitter>
<sdogruyol> ugh
<FromGitter>
<sdogruyol> isnt that a behaviour mismatch?
<BlaXpirit>
"be more permissive with initialize as macro methods" - finally he ran into a usecase for what should've been there all along
<BlaXpirit>
oh but it's just that case, seems like calling other macros still doesnt count as initialization
<FromGitter>
<sdogruyol> should calling be count as init?
<FromGitter>
<spalladino> @splattael the `Hash` vs `Set` `#merge` is definitely a nasty surprise; could you open an issue on the repo?
gloscombe has quit [Ping timeout: 245 seconds]
gloscombe has joined #crystal-lang
<crystal-gh>
[crystal] Sija opened pull request #3623: Select anchor from location.hash on page load (master...docs-onload-anchor) https://git.io/v1cuJ
<RX14>
@asterite are you around?
pawnbox has joined #crystal-lang
<FromGitter>
<splattael> @spalladino sure!
tomchapin has quit [Read error: Connection reset by peer]
<RX14>
@splattael Hash#merge should merge types, and so should Set#merge
<FromGitter>
<splattael> @RX14 Oh, really. I would not expect that because `Hash#merge!` does not do this neither.
<FromGitter>
<splattael> (yeah, I know why)
<RX14>
thats because you can't change the type on an existing object
<FromGitter>
<splattael> ^
<RX14>
there's no rule that mege and merge! have to have exactly the same semantics
<RX14>
merge on set should be called merge! actually
tomchapin has quit [Read error: Connection reset by peer]
<FromGitter>
<splattael> @RX14 what do you mean by "rule"? In Crystal (and Ruby) it is common sense that bang-methods behave *exactly* like the "normal" ones except they modify the receiver.
<RX14>
but in crystal they can't
<FromGitter>
<splattael> Of course, there are exceptions but in most cases they both have the same semantics.
<RX14>
so they act the same behaviourly
<RX14>
but don't modify the type
<RX14>
because they can't
<RX14>
you can use type restrictions on your methods, or use `.as` to specify that the merge argument is a specific type
<FromGitter>
<splattael> That's my point. IMHO `#merge{,!}` should only merge values and check types.
<FromGitter>
<splattael> `#union` might also merge types.
<FromGitter>
<paulcsmith> I've tried searching the mailing list and issue tracker and I haven't found anything about how to do this, so maybe it's not possible :S
<tilpner>
No, that's not what you want, but maybe you can build from it
<FromGitter>
<paulcsmith> @sdogruyol Oh I see what you mean. Those are keywords args. Even when I use a hash or wrap the call to `form_for` in parens it throws the error. It doesn't throw the error when I use `<%` (no `=`_
<FromGitter>
<paulcsmith> It only does it when I use the `<%= %>` with the block. So it seems like outputting the block is not supported. But that seems odd to me that it wouldn't be
<FromGitter>
<paulcsmith> So I'm not sure if I'm just missing something obvious
<tilpner>
(But I don't know what heroku/cedar is)
rolha has joined #crystal-lang
<FromGitter>
<sdogruyol> @paulcsmith i've done that with kemal
<FromGitter>
<sdogruyol> hold on
<FromGitter>
<sdogruyol> ofc it has to be a macro for expansion
<FromGitter>
<paulcsmith> Kind of a bummer it needs to be a macro, but that should work. Thanks @sdogruyol!
<FromGitter>
<paulcsmith> Well I can see why it needs to be for the content_for stuff, but too bad it needs to be for form_for since it's not really doing much
<FromGitter>
<sdogruyol> well since it's doing dynamic template generation
<FromGitter>
<sdogruyol> it has to be at compile time like ecr
<FromGitter>
<sdogruyol> @paulcsmith are you building a helper library for ECR?
<FromGitter>
<sdogruyol> i think we really need something like that
<FromGitter>
<paulcsmith> I'm building some view helpers for an app I'm working on. I'm sure it could be extracted and used for other libs though
<FromGitter>
<sdogruyol> yeah
<FromGitter>
<paulcsmith> For example, `form_for` would set the action in a hidden field for `PUT` requests, set CSRF, etc.
<FromGitter>
<sdogruyol> someone has to do that for sure :)
<FromGitter>
<sdogruyol> yup
<FromGitter>
<sdogruyol> i was thinking of doing something like that
<FromGitter>
<sdogruyol> for kemal ofc
<FromGitter>
<sdogruyol> first step is to build a common library then plug kemal into it
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<FromGitter>
<paulcsmith> Yeah I'll try to get it to a point that it's usable outside this project. Also tested so I know there aren't regressions :P
<FromGitter>
<sdogruyol> @paulcsmith good job :)
<FromGitter>
<catmando> is it possible to use crystal / kemal somehow with ActiveRecord?
<FromGitter>
<sdogruyol> @catmando not with the AR from Ruby
<FromGitter>
<catmando> but?
<FromGitter>
<paulcsmith> So far thinking with static types has been tricky. I have to rethink a lot of things, but I think the design in the end is better
<FromGitter>
<sdogruyol> there used to be activerecord.cr but it's not maintained
<FromGitter>
<paulcsmith> Plus compiler catches a lot of stuff (which is nice)
<FromGitter>
<sdogruyol> @paulcsmith it leads to a future proof design for sure
<FromGitter>
<catmando> so what do people use for persistence in kemal?
<FromGitter>
<paulcsmith> mongo :P
<FromGitter>
<paulcsmith> jk crystal-pg
<FromGitter>
<paulcsmith> or crystal-db if you use mysql
<FromGitter>
<sdogruyol> @catmando for me i use Kemal + Tren with crystal-db
<FromGitter>
<sdogruyol> or pg yeah
<FromGitter>
<paulcsmith> There are also a few ORMs that people are working on, but most are pretty early stages
<FromGitter>
<sdogruyol> after leaving Ruby-land i dont wanna use any orm anymore
<FromGitter>
<sdogruyol> SQL is pretty good at what it is
<FromGitter>
<johnjansen> haha @sdogruyol im pretty sure its not the SQL part that most people want out of and ORM, they want the model end … happy to be wrong on this of course
<FromGitter>
<sdogruyol> @johnjansen yeah, imho Repository pattern is much more better for that
<FromGitter>
<johnjansen> thats interesting, i havent tripped over any of those to date
<FromGitter>
<johnjansen> must remember that
<FromGitter>
<sdogruyol> i like ecto so this would be a great fit
<FromGitter>
<sdogruyol> actually i'm curious if we can have LINQ for Crystal
<FromGitter>
<catmando> The reason i ask is that we are loving http://ruby-hyperloop.io and I am trying to figure out how to port this to crystal. The two big missing pieces would be a crystal -> js (for the client side) and some kind of ORM. HyperLoop includes a gem (HyperMesh) that makes your AR models available directly on client.
<Papierkorb>
That hyperloop thing looks like VoltRb
<FromGitter>
<catmando> @sdogruyol yes I have started chatted with the author. I was surprised however that he was not just using emscripten which seemed like a much easier route.
vivus-ignis has joined #crystal-lang
<FromGitter>
<sdogruyol> ugh
<Papierkorb>
Why would they? Opal has come a long way
<FromGitter>
<sdogruyol> hold on i have something useful for you
matp has joined #crystal-lang
<FromGitter>
<paulcsmith> Whoah. I haven't seen emscripten before. Seems very cool
<FromGitter>
<paulcsmith> Crystal -> js would be awesome
<FromGitter>
<sdogruyol> you can share your Crystal code with JS with this
<FromGitter>
<paulcsmith> That's pretty cool
<FromGitter>
<paulcsmith> I was actually wondering about this the other day. How to share models with the front end so they never get out of date
<FromGitter>
<paulcsmith> Combine with flow or typescript and it could even be checked at compile time
<FromGitter>
<catmando> A lot of ideas from volt went into HyperMesh (the persistence part of HyperLoop) but the problem with volt (for me anyway) was I needed a way to integrate with an existing rails app.
<FromGitter>
<sdogruyol> well kreal was a good idea but unfortunately @f is not maintaining it
matp_ has quit [Ping timeout: 250 seconds]
<FromGitter>
<johnjansen> well @f that then ;-) JOKE
<FromGitter>
<sdogruyol> hahaha
<FromGitter>
<sdogruyol> nice one
<FromGitter>
<sdogruyol> he is also known as fakin lol
<FromGitter>
<johnjansen> ‘a’ not ‘u'
<FromGitter>
<sdogruyol> i meant IRL name
<FromGitter>
<johnjansen> :-)
shawn42 has left #crystal-lang [#crystal-lang]
soveran has quit [Remote host closed the connection]
vivus-ignis has quit [Ping timeout: 260 seconds]
<crystal-gh>
[crystal] rdp opened pull request #3627: make builds cross compile to correct target for x86_64-apple-darwin16.1.0 (master...osx_triple) https://git.io/v1C9s
<crystal-gh>
[crystal] rdp opened pull request #3628: mention that there are many other options, not shown in the default help (master...note_more_help_available) https://git.io/v1CQt