<FromGitter>
<paulcsmith> That did it!! Thanks again
<FromGitter>
<Blacksmoke16> mhm
kotrcka has joined #crystal-lang
adam12 has left #crystal-lang [#crystal-lang]
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #crystal-lang
<sagax>
hi all!
<sagax>
crystal very awesome
<FromGitter>
<Blacksmoke16> indeed
<FromGitter>
<smalls12> was on the crystal landing page, specifically on install ( https://crystal-lang.org/install/ ) and noticed that if you click the rotating crystal in the top left, it just freezes and stops rotating
<FromGitter>
<smalls12> should it redirect to homepage?
<FromGitter>
<smalls12> ( just a funny quirk )
ur5us has quit [Ping timeout: 250 seconds]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
lanodan has quit [Ping timeout: 240 seconds]
lanodan has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter>
<naqvis> that allows to use mouse-up/down to rotate the crystal
<FromGitter>
<3n-k1> okay, so is there something like `methods` but for the class and instance variables?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter>
<3n-k1> how do I use `instance_vars`?
<FromGitter>
<naqvis> what is your use-case? or what is it you are trying to achieve?
<FromGitter>
<3n-k1> just screwing around. found a github issue, realized it only works in methods, not `finished`
return0e_ has joined #crystal-lang
<FromGitter>
<3n-k1> which is interesting because finished can call that method /shrug
DeBot has quit [Ping timeout: 246 seconds]
return0e has quit [Ping timeout: 250 seconds]
deavmi has joined #crystal-lang
davic has quit [Excess Flood]
<Subsentient>
How do I perform a narrowing integer cast in Crystal?
<oprypin>
Subsentient: that.to_i16
<Subsentient>
oprypin: So it's a method, there's no cast operator?
<oprypin>
why do u want an operator specifically
<oprypin>
there's a universal wrapper too. Int16.new(that)
<oprypin>
not sure if that might have changed with the overflow handling. maybe it needs to be new! if u want to truncate instead of erroring on overflow
<FromGitter>
<naqvis> to avoid overflow use bang! operator `that.to_i16!`
<Subsentient>
The problem I'm having is converting a UTF-32 Char to 7-bit ASCII. I know the character will always only be 7-bit. I want to convert a Char to UInt8
<Subsentient>
Without checking for overflow
<Subsentient>
I get "Invalid integer" when invoking e.g. 'h'.to_u8
<Subsentient>
In C I'd just do (char)L'h' and that'd be the end of it
return0e has joined #crystal-lang
<raz>
crystal 0.34 has been out for multiple hours but homebrew still points to 0.33
* raz
is deeply disappoint
<raz>
on a more serious note :P - how do you guys keep your crystal on osx? with homebrew or one of the version mgrs?
return0e_ has quit [Ping timeout: 258 seconds]
ur5us has joined #crystal-lang
<Subsentient>
So nobody knows how to convert a Char to a UInt8 unconditionally?
<Subsentient>
Short of endian-dependent bit fiddling?
<oprypin>
Subsentient: you have been told how in 2 ways by 2 people
<Subsentient>
oprypin: Both of those ways throw a runtime exception
<oprypin>
raz: homebrew updates at its own pace manually
<oprypin>
Subsentient: look for "!" in the messages that's the key
<raz>
oprypin: yup i know. wasn't entirely serious, just eager to try out the new shards (sounds like it got a speed boost) :)
deavmi has quit [Remote host closed the connection]
deavmi has joined #crystal-lang
<FromGitter>
<naqvis> 🎉
deavmi has quit [Remote host closed the connection]
deavmi has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
Subsentient has quit [Ping timeout: 260 seconds]
<FromGitter>
<ImAHopelessDev_gitlab> hello
<FromGitter>
<ImAHopelessDev_gitlab> how is everyone doing
_ht has quit [Quit: _ht]
_ht has joined #crystal-lang
_ht has quit [Client Quit]
<FromGitter>
<naqvis> hi Girng, so far so good. how are you doing?
_ht has joined #crystal-lang
<FromGitter>
<ImAHopelessDev_gitlab> Good ty
Subsentient has joined #crystal-lang
postmodern has joined #crystal-lang
<FromGitter>
<faustinoaq> @ImAHopelessDev_gitlab Working from Home is better than I though 😁
ur5us has joined #crystal-lang
darkstardev13 has quit [Read error: Connection reset by peer]
darkstardev13 has joined #crystal-lang
<repo>
Blacksmoke16: hey, how would i set the status code for a response in athena?
<repo>
not an error code but in this case 201 - CREATED
<FromGitter>
<Blacksmoke16> with a JSON response, or empty response body?
<FromGitter>
<Blacksmoke16> would be like `Response.new status: :accepted`
<FromGitter>
<Blacksmoke16> or `Response.new obj.to_json, status: :accepted`
<FromGitter>
<Blacksmoke16> er sorry, `:created`
_ht has quit [Quit: _ht]
blassin has joined #crystal-lang
<blassin>
hello all
<blassin>
is there any way to have "partials" in ECR templates?
<FromGitter>
<Blacksmoke16> not afaik
<blassin>
I have a template with <%= render_partial "home.ecr %> but then when I define the `render_partial` method, I try to pass the argument I get to ECR.render but I get "undefined macro variable"
<FromGitter>
<Blacksmoke16> i think you could do something like
<FromGitter>
<Blacksmoke16> good call on that, i really like that approach
<FromGitter>
<Blacksmoke16> going to bump that macro def pr again here soon. Once thats merged it unblocks me from some stuff i want to do in DI and by extension athena itself
<repo>
nice
<repo>
Issue is open.
<FromGitter>
<Blacksmoke16> <3 cheers
<FromGitter>
<Blacksmoke16> ill get that done this week then you can upgrade to that commit if you needed
<repo>
that'd be sweet! But it's a hobby project of mine, so no stress :)
<FromGitter>
<Blacksmoke16> no no, is nice to finally get some actual feedback (i.e. people using it heh)
<repo>
:)
<repo>
it's a bit rough on the edges imho, but i really like the overall concepts. I feel that athena is the only framework that doesn't get in my way.
<FromGitter>
<Blacksmoke16> id agree with that, most of the effort has gone into the core framework/loop
<FromGitter>
<Blacksmoke16> that good/better abstractions could be built on
<repo>
Blacksmoke16: you don't have a way to omit writing the full class name in annotations do you? I've got the same problem with JSON::Field annotations. It's annoying if you use namespaces alot, which i do. :/
<FromGitter>
<Blacksmoke16> with the goal of mostly everything being decoupled and interchangeable via DI, so testing and doing custom logic is easy and just works
<repo>
yeah
<FromGitter>
<Blacksmoke16> thats a byproduct of crystal not having imports like ES6 or PHP `use xxx`
<FromGitter>
<Blacksmoke16> either include the modules or make some aliases?
<repo>
mh
<repo>
i wonder if aliases defined in the class where the annotations are defined will work