<Papierkorb>
aisrael, you don't have to type an underscore before the type suffix: `1i64` This makes that typo less likely, as you only use underscores as thousands seperator. Reading that line with that in mind now becomes more obvious that it's wrong
<FromGitter>
<aisrael> TIL thanks
<Papierkorb>
No thank you, now I finally have an objective reason against the "underscore before type suffix" notation style :D
<FromGitter>
<aisrael> Also: don’t global search and replace `_i64` with `i64` in all files.
<FromGitter>
<aisrael> (Otherwise, you’ll be fixing `toi64` and `asi64` immediately after)
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Client Quit]
<FromGitter>
<bew> If we restrict underscore in numbers to 3 by 3 numbers (`1_024` is ok, but not `12_67`), this could be prevented
<Papierkorb>
In that case it has to be different per numerical base
<Papierkorb>
Or rather, for hex and binary it'd be groupings of 2^n and for decimal 3^n, with n >= 1
<FromGitter>
<bew> Oh yeah good point
<FromGitter>
<aisrael> Yay—I finally grok’d the relationships between `YAML::Any` and `YAML::Type` (and `JSON::Any`, and `JSON::Type`)
duane has joined #crystal-lang
ua_ has quit [Read error: Connection reset by peer]
ua has joined #crystal-lang
radagast_04 has joined #crystal-lang
ome_ has quit [Quit: Connection closed for inactivity]
duane has quit [Ping timeout: 256 seconds]
early has quit [Ping timeout: 260 seconds]
early has joined #crystal-lang
alex`` has joined #crystal-lang
Ven`` has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
Ven`` has quit [Ping timeout: 268 seconds]
Ven`` has joined #crystal-lang
radagast_04 has quit [Ping timeout: 255 seconds]
Ven`` has quit [Ping timeout: 255 seconds]
<FromGitter>
<bararchy> Where are the `crystal env` settings get saved?
<FromGitter>
<bararchy> (linux)
<jhass>
what do you mean?
<jhass>
the compiled in defaults?
<FromGitter>
<bararchy> Oh, so the defaults are hardcoded, not in some file somewhere ?
<FromGitter>
<bararchy> it seems I get a bug using arch aur for HEAD, it creates a false PATH
<jhass>
no, they're determined at compile time and saved as constants in the compiler binary
<FromGitter>
<aisrael> Anyone here working on `crystal-db` or `crystal-pg`? I can’t seem to make positional parameters work on an `INSERT` statement (but injecting the values into the SQL string directly works)
<FromGitter>
<aisrael> (Ok, I just did a quick test and it doesn’t seem to work for `SELECT` either.)
<FromGitter>
<aisrael> NVM, I feel stupid now. I just read the docs *more carefully* and saw there where it says "Note: When using the pg driver, use `$1`, `$2`, etc. instead of `?`” so I only *wish* `crystal-db` either abstracted that away entirely, or made it first class (to allow `$n` to be used more than once), or at the very least made that note stand out a little more :)
<FromGitter>
<x86128> Hello. Newbie question about YAML parsing. This snippet compiles with error in line 17, I guess I need to explicitly tell the compiler that type I expects. ⏎ ```So, p.va.class tells "Hash(YAML::Type, YAML::Type". ⏎ Please, point me direction to dig? 😄``` [https://gitter.im/crystal-lang/crystal?at=5a86b1966017bf221a713236]
<FromGitter>
<aisrael> Ok, I’ll take a crack (since I’ve only started to understand it myself just today)… First off, `YAML::Any` is a wrapper that wraps a value. That value is of type `YAML::Type` ⏎ When you do `YAML::Any#as_h`, it stops becoming a wrapper—instead, it now returns a `Hash(YAML::Type, YAML::Type)`
<FromGitter>
<aisrael> A `YAML::Type` does *not* have a `as_h` method (at least, not all types)
<FromGitter>
<j8r> @x86128 you have already used `as_h` with `v.as_h`. Just remove it, and you can use `va.as_h`
<FromGitter>
<j8r> like @aisrael said, you can only use once `as_[wathever]`
<FromGitter>
<x86128> @j8r thanks for reply, but how than to access returned hash table if they key is YAML::Type but I need "login" field?
<FromGitter>
<x86128> I mean variable "va" that stands for "{"login" => "admm", "pass" => "123"}" in textual representation
<FromGitter>
<j8r> if you juste `p va`, does the key exists?
bijan_ has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 248 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<bararchy> jhass thanks :)
Ven`` has joined #crystal-lang
duane has joined #crystal-lang
radagast_04 has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua has quit [Ping timeout: 276 seconds]
ua has joined #crystal-lang
<FromGitter>
<aisrael> Does Crystal `Time` have time zones? I see that `Time::Format` has a `%z` directive but I can’t find how to set or change the time zone for a `Time`
<RX14>
No
<RX14>
Not yet
<RX14>
Its in master I think
<RX14>
Or at least in a pr
<FromGitter>
<straight-shoota> Yeah #5324 is merged, using arbitrary time zones will be in the next release
<FromGitter>
<straight-shoota> before, the only time zones supported were UTC, unspecified and local where `%z` would print `00:00`for the first two and the current time zone offset of your system for local.
<FromGitter>
<aisrael> Thanks. Was half thinking of implementing it myself already (wrote my own TZ conversion library in Java way way back).
<FromGitter>
<straight-shoota> It's not really battle tested right now, so please give it a try ;)
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
maattdd has quit [Ping timeout: 260 seconds]
maattdd has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
Ven`` has joined #crystal-lang
<crystal-gh>
[crystal] jhass closed pull request #5720: Ensure that HTTP::WebSocket uses SNI, just like HTTP::Client. (master...sni) https://git.io/vAZgS
<FromGitter>
<j8r> is it normal to have this type of error: ⏎ `wrong number of arguments for macro 'create' (given 3, expected 3)`
<FromGitter>
<sdogruyol> TechEmpower Web Framework Benchmarks Round 15 is up everyone https://www.techempower.com/benchmarks/ Crystal frameworks are doing a good job 👍
Ven`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter>
<straight-shoota> j8r, not that's not normal
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
Ven`` has quit [Client Quit]
<FromGitter>
<j8r> I will try to reproduce it in a condensed example, I was calling a macro def with `super`
rohitpaulk has joined #crystal-lang
vivus has joined #crystal-lang
Ven`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
rohitpaulk has joined #crystal-lang
maattdd has quit [Ping timeout: 256 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has joined #crystal-lang
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
Ven`` has joined #crystal-lang
olbat has quit [Ping timeout: 256 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 1.9]
rohitpaulk has quit [Ping timeout: 260 seconds]
shalmezad has quit [Quit: Leaving]
ikanobori has joined #crystal-lang
DTZUZU has joined #crystal-lang
<watzon>
@jr8 I saw that on Reddit yesterday. I'm actually surprised Crystal isn't higher up, but I'm not at all surprised to see Rust at the top
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<bew> TIL that string comparaison is instant when the strings are compile time constant (not coming from a string operation)
Vexatos has quit [Quit: ZNC Quit]
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
RX14 is now known as Guest28202
Vexatos has joined #crystal-lang
duane has quit [Ping timeout: 264 seconds]
<watzon>
So `JSON.mapping` doesn't create an initializer that takes a Hash or NamedTuple? Is there a reason why?
<FromGitter>
<bew> That's your job?
<FromGitter>
<bew> JSON.mapping just make the methods from_json and to_json work (adding an initializer for jon's pull parser is an implementation detail)