<FromGitter>
<drujensen> curious, how would you would handle precedence when defined this way? which route has priority?
<rocx>
okay maybe one other question: in the error message "@instance_vars are not yet allowed in metaclasses"... presumably this is a planned feature?
rocx has quit [Quit: ERC (IRC client for Emacs 26.1)]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 240 seconds]
Renich has quit [Ping timeout: 246 seconds]
Dreamer3 has quit [Quit: Leaving...]
spacemanspam has joined #crystal-lang
<FromGitter>
<galvertez> so it looks like `macro inherited` always runs at the beginning of a class definition when inheriting, i.e. before any defs are added etc., but is there anything i can do that will run at the *end* of class definition when inheriting?
<FromGitter>
<galvertez> that was kind of surprising to me because in ruby `self.inherited(r)` always runs at the end, and there's nothing you can do that runs at the beginning... that was always annoying
<FromGitter>
<galvertez> but now in crystal i have the opposite problem lol
_whitelogger has joined #crystal-lang
<FromGitter>
<girng> @talbergs weird how you don't know the types in mysql. i always thought the columns had to have a type set. unfortunately that's all i can help with. can try posting on SO (i'll upvote), or on the forum, etc
<FromGitter>
<vifreefly> There is `Fiber.current` but it looks like there is no API to set and get fiber-local variables
<FromGitter>
<straight-shoota> @vifreefly No, there aren't any fiber-local variables. Depending on the use case, it's recommended to either use a `Hash(Fiber, T)` or reopen `Fiber` class or add an instance variable. The latter is especially useful if most fibers nee to have that variable.
<FromGitter>
<straight-shoota> You could probably also subclass `Fiber` with necessary instance variables.
<FromGitter>
<vifreefly> This is awesome! So it looks like to implement this feature will be easy as you described, thanks
<FromGitter>
<valenciaj> Hi there! There are a shard to make PDF's but not WkHtmlToPdf? Thanks!
<mps>
valenciaj: could you post url of the PDF shard, please
<FromGitter>
<valenciaj> @FromIRC I'm asking for a shard
<mps>
valenciaj: ok, understand
gangstacat has quit [Quit: Ĝis!]
<FromGitter>
<bararchy> @vladfaust we got two developers from Belarus, so if you get the meetup going I'll let them know
<FromGitter>
<vladfaust> Thank you, Bar
<FromGitter>
<bararchy> NP, thanks for arranging this event
laaron has joined #crystal-lang
gangstacat has joined #crystal-lang
_whitelogger has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
cyberarm has quit [Ping timeout: 246 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
spacemanspam has quit [Read error: Connection reset by peer]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<straight-shoota> @valenciaj No, I don't think there is anything in that direction. PDF creating is a pretty complex topic
<FromGitter>
<bararchy> yeha, but btw ruby has a great one
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<j8r> async/await is a pain is Python :(
Raimondi has quit [Ping timeout: 240 seconds]
<FromGitter>
<asterite> @galvertez you can probably put a `macro inherited` inside a `macro finished`
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
Renich has joined #crystal-lang
akaiiro has joined #crystal-lang
<FromGitter>
<straight-shoota> Somebody interested in background job queues in Crystal? There are a number of different shards available. I've put together a proposal for a standardized API like Active Job: https://github.com/straight-shoota/taskmaster Any feedback is welcome.
<robacarp>
interesting
<FromGitter>
<j8r> Hum there is no `File#read` :|
laaron has quit [Remote host closed the connection]
<FromGitter>
<j8r> why we wont have read to? It look logical API-wise
<FromGitter>
<straight-shoota> There is. It's just called `#gets_to_end` because `File` is an IO
<FromGitter>
<j8r> It's a bit strange, there are IO method, but there is delete - IO#delete
<FromGitter>
<j8r> that didn't exist indeed
<FromGitter>
<straight-shoota> delete is entirely different operation, not IO related
<FromGitter>
<rishavs> quick question. I keep getting confused where I should use `{} of String => Int32` and where to use `Hash(String , Int32)`
<FromGitter>
<j8r> of course @straight-shoota , why?
<FromGitter>
<straight-shoota> having it on `File` is nothing more than a shortcut
<FromGitter>
<j8r> On my mind File.new is an IO
<FromGitter>
<j8r> sort of
<FromGitter>
<straight-shoota> @rishavs `Hash(String, Int32)` is a type and `{} of String => Int32` initializes a new instance of that type. That's equivalent to `Hash(String, Int32).new`
<FromGitter>
<j8r> I still think having File#read as a shortcut like #delete would make sense...
<FromGitter>
<straight-shoota> but what's wrong with #gets_to_end ?
<FromGitter>
<j8r> we need to know how IO works, with gets_to_end, rewind and close
<FromGitter>
<j8r> the user only want to read a file, like with File.read
<FromGitter>
<rishavs> thanks @straight-shoota
<FromGitter>
<j8r> why we have File.read, not use File.open? That's the same topic
<FromGitter>
<j8r> off topic, you're quite active @straight-shoota - wow :o
<FromGitter>
<j8r> my GH notifications are full 💀
<FromGitter>
<straight-shoota> I've got a cold. Need distraction =)
<FromGitter>
<asterite> `File.read` existed before we introduced `gets_to_end`. It should probably be `File.gets_to_end` or something like that, or we should just have `read()` that reads the whole thing to a String, I don't know. The names are a bit confusing. `print` and `puts` are also confusing too for newcomers... but it might be late to change all of that
<FromGitter>
<straight-shoota> It's not just me, though. Today many people were very busy.
<FromGitter>
<straight-shoota> I think `File.read` is fine. It opens the file, reads its contents into memory and and closes it. I think this is pretty accurately described as `.read`
<FromGitter>
<straight-shoota> there's already a new one
<RX14>
oh
<RX14>
that is the new one you linked to
<RX14>
but yeah
<RX14>
thanks
<RX14>
it's a PR with a lot of review + comment work for, honestly, marginal benefit
sagax has joined #crystal-lang
<FromGitter>
<Blacksmoke16> @asterite What openssl version are you on?
<z64>
an update on https://github.com/crystal-lang/crystal/pull/6901 would be great; i know the parent issue is at least blocking crystal-db from getting logging support, which all drivers would then benefit from
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<straight-shoota> RX14 agreed. It's still a nice change. And seems like the author is pretty enthusiastic about contributing. That's definitely a good thing.
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<dwightwatson> hi all - silly question... how might i get the length of an integer?
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<dwightwatson> i've come up with `status_code.to_s.size == 3` but it feels *wrong*
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<oprypin>
dwightwatson, there's no such thing as length of an integer
laaron has quit [Remote host closed the connection]
<oprypin>
there is length of the decimal representation, and `to_s` returns the decimal representation
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<FromGitter>
<dwightwatson> i was reading from your comment here...
<FromGitter>
<dwightwatson> ```code paste, see link```
<FromGitter>
<dwightwatson> whoops didn't mean to make it a single line
<FromGitter>
<straight-shoota> This only makes sense when the status code is provided as text. In the Crystal implementation that would be in `Response.from_io`
<FromGitter>
<straight-shoota> When it is already passed as a number, it doesn't make sense to count digits in the string representation
<oprypin>
yeah
<FromGitter>
<straight-shoota> `status_code.to_s.size == 3 && 0 <= status_code <= 999` is equivalent to `100 <= status_code <= 999`
<FromGitter>
<dwightwatson> ah... yeah good point
<FromGitter>
<dwightwatson> clearly haven't had my morning coffee yet
<FromGitter>
<dwightwatson> alright i'll pop it back to `100 <= status_code <= 999`
<FromGitter>
<straight-shoota> Yeah, just revert the last commit
<FromGitter>
<straight-shoota> And I wouldn't bother about `000..999`, I don't think it's worth it.
<oprypin>
it's not worth anything, it's probably done to avoid a dynamic string allocation or something silly
<FromGitter>
<straight-shoota> what are you refering to?
<FromGitter>
<theretromaniac> hello folks! Happy to join
<FromGitter>
<dwightwatson> had a massive battle trying to revert that commit so will just squash it later if you like
<FromGitter>
<dwightwatson> were there any other changes you'd like to that PR?
Raimondi has joined #crystal-lang
<FromGitter>
<straight-shoota> No, I think it looks fine
<FromGitter>
<straight-shoota> Will review tomorrow :D
<FromGitter>
<dwightwatson> awesome, thanks for all your help