jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.28.0 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 245 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbbba111cd0b8307d46ff13]
<FromGitter> <Blacksmoke16> `SELECT name, address FROM contacts s JOIN settings r ON s.id = r.user_id WHERE (r.address = ? AND s.age >= ? AND s.name = ?);`
<FromGitter> <Blacksmoke16> #progress
<FromGitter> <Blacksmoke16> oops
<FromGitter> <Blacksmoke16> thoughts/comments?
alexherbo2043 has quit [Quit: The Lounge - https://thelounge.chat]
_whitelogger has joined #crystal-lang
beepdog has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <vladfaust> Compare to this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbc0802375bac7470dc741f]
DmitryBochkarev has joined #crystal-lang
<wuehlmaus> apropos hedron, anybody gets the examples running? i just want to exclude that it's my fault or my os that is the problem
<wuehlmaus> as i am running crystal on macosx i think that usage of qt is not working. does that leave me with hedron or are there other gui frameworks on osx?
<wuehlmaus> and libui doesn't do it for me neither :-(
ashirase has quit [Ping timeout: 245 seconds]
ashirase has joined #crystal-lang
Jenz has joined #crystal-lang
<Jenz> How come crystal doesn't infer the type (Bool) of Enumerable#{all, none, any, one}?
<Jenz> They all return either true or false, so they really should be inferred as Bool
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
DTZUZO has quit [Ping timeout: 255 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<Jenz> But they don't, hence the compiler error. What part in their definitions makes the compiler not able to infer their types?
<Jenz> They've all pretty similar defs have a look at `#all?` for example: https://github.com/crystal-lang/crystal/blob/master/src/enumerable.cr#L46-L72
<Jenz> All three clauses call the first (`#all?(&block)`), which very explicitly returns either true or false
<FromGitter> <bew> Well the error message explains it quite well
<FromGitter> <bew> Jenz: could specify the type with: https://carc.in/#/r/6riq
<FromGitter> <bew> But it doesn't work either because the block is expanded in the struct' and you're not allowed to reference the other ivars in this context
<FromGitter> <bew> You could do with a lazy ivar: https://carc.in/#/r/6riu
<Jenz> Oh yeah record doesn't work here
<Jenz> But annotating the type is no problem
<Jenz> I'm just wondering *why* the type isn't inferred
<FromGitter> <bew> Because the return type is not specified on the declaration of these methods
<Jenz> `true` and `false` are literal Bools, and according to the error messages rule 1, type should be inferred
<FromGitter> <bew> Hum no, the compiler doesn't check inside the methods
<Jenz> Huh
<Jenz> I'd thought it would, but ok, thanks
<Jenz> So if I have: `def returns_true; true; end`, and in a class, `@foo = returns_true()`, the compiler won't infer the type.
<FromGitter> <bew> ... I did a few tests and it absolutely not behaved like I thought it would... I guess the compiler has some weird corner case to either make something work or not..
Jenz has quit [Ping timeout: 255 seconds]
<FromGitter> <bew> Yeah
DTZUZO has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> @Blacksmoke16 ooof that's fun :/
<FromGitter> <dscottboggs_gitlab> (regarding #7698 ) ^^
<DeBot> https://github.com/crystal-lang/crystal/issues/7698 (Proc with Nil return type causes other procs to always return nil)
<FromGitter> <dscottboggs_gitlab> ...so why is `Process::Status#exit_code` an `Int32` when it can only ever be a `UInt8`?
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
hightower3 has joined #crystal-lang
_whitelogger has joined #crystal-lang
<oprypin> dscottboggs_gitlab, im not sure thats true
<oprypin> what do u think about C's `int main`
<oprypin> and im certain on Windows there are status codes like minus a million reserved by the system
<FromGitter> <dscottboggs_gitlab> yeah I thought windows might have something to do with it...but you're right, it is `int main` not `unsigned char main`
<FromGitter> <dscottboggs_gitlab> returning 300 from a c program returns 44 to the shell, and -5 returns 251 to the shell...so I must be just thinking of a posix shell limitation as opposed to a normal C thing.
<oprypin> dscottboggs_gitlab, you seem correct there. another confirmation:
<oprypin> `python -c "import subprocess; print(subprocess.call(['python', '-c', 'import sys; sys.exit(-5)']))"`
<oprypin> `251`
<oprypin> not even posix shell is involved
<FromGitter> <dscottboggs_gitlab> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbc5d3a4b4cb471d9320727]
* FromGitter * dscottboggs_gitlab boots up a windows vm
<FromGitter> <dscottboggs_gitlab> Ok so it's not an `UInt8` *nor* an `Int32` in windows... sec
<FromGitter> <dscottboggs_gitlab> Yeah I don't even know what's going on in windows... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbc61aa990feb4518daa36f]
<FromGitter> <Blacksmoke16> @vladfaust Yes but the former is reusable, i.e. could make that query and reuse it, similar to like `HasName.new("name")`. Also the values are all type safe, so if you pass a Float to the `age` `gte` part, it wouldnt compile
<FromGitter> <Blacksmoke16> which i think is worth the extra bit of typing
<FromGitter> <vladfaust> https://docs.onyxframework.org/sql/query.html#getting-started reusable and type-safe, no need to reinvent a wheel
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <Blacksmoke16> are some other differences as welll
<FromGitter> <Blacksmoke16> @dscottboggs_gitlab yea, had to check if return type was Nil, and if it was map it to a private class that i check for instead of nil
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5cbc743e3d78aa6c036e05b7]
<FromGitter> <Blacksmoke16> so given you have a complex query, with conditionaly adding additional requirements, could just do `Model.match(IsActive.new("abcd"))`
<FromGitter> <j8r> mps how goes Crystal 0.28.0 on Alpine? Any help needed?
<mps> j8r: I'm trying to build static apk package of previous version (0.27.2) which is needed to build 0.28.0
<mps> i.e. in one build pass to build both, static and shared apk
<mps> actually I did this, but now wrestling with package manager to make it's conflict and depends options to work correctly
<mps> for the test I've built 0.28.0 yesterday, and it worked nice
Jenz has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 246 seconds]
DmitryBochkarev has joined #crystal-lang
DmitryBochkarev has quit [Remote host closed the connection]
DmitryBochkarev has joined #crystal-lang
Jenz has quit [Ping timeout: 268 seconds]
<FromGitter> <NinoFurger> Hallo. I just updated crystal and I'm currently trying to build scry, but i get the following error. Any idea why? ⏎ ⏎ `Error target scry failed to compile: ⏎ Error in src/scry.cr:4: while requiring "./scry/context" ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5cbc901ee416b84519b812cd]
<FromGitter> <Blacksmoke16> scry prob needs updated for 0.28.0
<FromGitter> <NinoFurger> I don't know how I didn't find this. thank you a lot
<FromGitter> <Blacksmoke16> np
Jenz has joined #crystal-lang
hightower3 has quit [Ping timeout: 244 seconds]
Jenz has quit [Ping timeout: 255 seconds]
DmitryBochkarev has quit [Ping timeout: 255 seconds]
DmitryBochkarev has joined #crystal-lang
Jenz has joined #crystal-lang
Jenz has quit [Ping timeout: 250 seconds]
fanta1 has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
Jenz has joined #crystal-lang
Jenz has quit [Ping timeout: 246 seconds]
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<mps> j8r: if you have time look at this http://tpaste.us/J6pl it is from 'make spec' rebuilding 0.27.2
<mps> in previous build this is not happened. suspect in yaml lib upgrade
Jenz has joined #crystal-lang
fanta1 has quit [Quit: fanta1]
<FromGitter> <j8r> mps it was supposes to be fixed by https://github.com/crystal-lang/crystal/pull/7555
<mps> aha, thanks, it doesn't appeared in 0.28.0 in my yesterday build
<FromGitter> <j8r> The yaml package is in `0.2.2-r0`
<mps> forgot exact version, and I'm not at build machine right now
<FromGitter> <j8r> We can open an issue
<mps> if you think it deserves it, I'm ok with it
<FromGitter> <j8r> The fix is to change to `if YAML.libyaml_version <= SemanticVersion.new(0, 2, 1)`
<mps> but, I made a patch to skip this test
<FromGitter> <j8r> Because `0.2.2-r0 < 0.2.2`, that's the problem
<FromGitter> <j8r> I submit a PR
<mps> no, alpine packages always have -rX where X is pkg release version
<mps> so there couldn't exist package 0.2.2 version
<FromGitter> <j8r> https://carc.in/#/r/6rmb
Welog has joined #crystal-lang
<FromGitter> <j8r> thanks mps, I am not sure I noticed this
<mps> I see now, thanks
<FromGitter> <j8r> ... not able to reproduce it, what crystal version was running? 0.28.0?
<FromGitter> <j8r> That's because the release part isn't taken https://github.com/crystal-lang/crystal/blob/master/src/yaml.cr#L164
<FromGitter> <j8r> you may have this issue because you run 0.27.2?
<mps> j8r: yes, the issue is in 0.27.2, not 0.28.0
<mps> sorry if I wasn't clear in my previous messages
<FromGitter> <j8r> so that's totally normal
<mps> I think 0.27.2 fix is not important because we will have 0.28.0 in repository soon, I hope
<FromGitter> <j8r> the specs are supposed to run in 0.28.0?
<mps> in 0.28.0 all works fine
<mps> maybe you didn't read my previous messages, I'm now building two versions of 0.27.2, one static to have bootstrap version apk for 0.28.0 and old 0.27.2 normal shared apk
<mps> with this new bootstrap version we will not need anymore to have tar.gz in dev.alpinelinux.org, it will be in 'normal' repo. this is my plan
<mps> what do you think of it? is it ok or you have some suggestions
japanoise has quit [Ping timeout: 252 seconds]
Jenz has quit [Ping timeout: 245 seconds]
<FromGitter> <j8r> I thought you were building 0.27.2 on 3.9
<FromGitter> <j8r> then 0.28.0 on edge
<FromGitter> <j8r> what's done with rust or go?
<mps> in 3.9 is 0.27.0 version
<mps> 0.27.2 is in edge, currently
<mps> because edge will become next stable (3.10) I want to upgrade crystal to 0.28.0 to be version in next stable
<mps> so, 0.27.2 will disappear actually
devil_tux has joined #crystal-lang
devil_tux has quit [Client Quit]
devil_tux has joined #crystal-lang
<FromGitter> <j8r> I see
<devil_tux> ola, can I ask someone to upgrade Crystal in brew? current formulae still points to older release: https://github.com/Homebrew/formulae.brew.sh/blob/master/_data/formula/crystal.json
Jenz has joined #crystal-lang
Jenz has quit [Client Quit]
<FromGitter> <Blacksmoke16> https://github.com/Homebrew/homebrew-core/pull/39026 its i nPR
<devil_tux> ah, my bad .. <3
laaron- has quit [Remote host closed the connection]
devil_tux has quit [Quit: leaving]
devil_tux has joined #crystal-lang
laaron has joined #crystal-lang
devil_tux has quit [Client Quit]
devil_tux has joined #crystal-lang
devil_tux has quit [Client Quit]
devil_tux has joined #crystal-lang
devil_tux has quit [Client Quit]
devil_tux has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 268 seconds]