<FromGitter>
<renich> This is kind of odd... It feels like I am repeating myself
<FromGitter>
<renich> @fridgerator Thanks a lot, man
<crystal-gh>
[crystal] MakeNowJust opened pull request #4735: Tuple: support negative index (master...feature/tuple/support-negative-index) https://git.io/v7kYm
<FromGitter>
<fridgerator> 👍
<FromGitter>
<GetRektByMe> @fridgerator Can I just say I'm a pretty big fan of your github.io already
<FromGitter>
<GetRektByMe> Just for that Ali-G quote
<FromGitter>
<fridgerator> lol, tyty
<FromGitter>
<GetRektByMe> Booyakasha fam
<FromGitter>
<GetRektByMe> :^)
<FromGitter>
<fridgerator> haha
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
pwned has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 248 seconds]
fenicks has quit [Ping timeout: 255 seconds]
fenicks has joined #crystal-lang
_whitelogger has joined #crystal-lang
pwned has quit [Ping timeout: 260 seconds]
<FromGitter>
<watzon> @faustinoaq using d-lib to send messages to the `org.razer` service
<FromGitter>
<watzon> We need to make QT bindings for Crystal
<FromGitter>
<watzon> @renich why not link to crystal play instead of taking a screenshot?
snsei_ has quit [Remote host closed the connection]
<oprypin>
watzon, yeah we do need Qt bindings. do you have knowledge of that?
<oprypin>
in particular, what if data.result was a function that returns a different type every time? the compiler ain't gonna risk being fooled by that
<oprypin>
watzon, also cheers re: dbus also i guess that's kde that you're using?
<crystal-gh>
[crystal] Val closed pull request #4531: [release container] update ubuntu LTS to latest (master...update_release_container_to_latest_ubuntu_lts) https://git.io/vHPML
<FromGitter>
<watzon> oprypin: you are correct dear sir
<oprypin>
watzon, what about that Qt though. i'd be scared to do it alone
<FromGitter>
<watzon> I would too lol. Especially since I don’t have much C experience. It doesn’t look like linking is really all that difficult though
<FromGitter>
<watzon> I just want to be able to write damn GUIs in Crystal!
<oprypin>
watzon, problem is it's not a normal C library or even a C++ library
Raimondii has joined #crystal-lang
<FromGitter>
<watzon> oprypin: Is it not? I haven't really looked yet
<oprypin>
:/ nevermind then
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<watzon> We could also always create bindings with something like CEGUI
<oprypin>
nah i'm like Qt or bust
pwned has joined #crystal-lang
crack08 has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<FromGitter>
<abidon> Hi everyone, just wanted to let you know that I released 3 libraries for crystal on Github, still WIP but already ready for use ⏎ ⏎ 1) libpq.cr (https://github.com/abidon/libpq.cr): a binding to the libpq library (postgres) ⏎ 2) crystal-pq (https://github.com/abidon/crystal-pq): an alternative to crystal-pg as I'm experiencing a lot of issues with it (it uses libpq.cr) ⏎ 3) and libargon2.cr
<FromGitter>
<watzon> Question. Is there an existing method in Crystal like numpy's bitwise_or (https://devdocs.io/numpy~1.13/generated/numpy.bitwise_or)? Or am I going to have to write my own? Basically I need to turn this `[1, 2], [4, 7]` into this `[5, 7]`
imnotarobot has joined #crystal-lang
imnotarobot has quit [Client Quit]
imnotarobot99 has joined #crystal-lang
<imnotarobot99>
is there a list somewhere where i can find all the types like "\n", "\t", "\r" ?
<oprypin>
watzon, `[1,2].zip([4,7]).map { |a, b| a | b }`
<oprypin>
crystal doesnt duplicate all possible methods as variants that operate on each element of an array
<oprypin>
it's abou damn time for TUIs to die though
<Groogy>
Hey I'm sitting in Weechat
<Groogy>
take that back >:(
<Groogy>
you hurt his feelings
<imnotarobot99>
can i maybe somehow use windows command in linux subsystem?
<oprypin>
imnotarobot99, no
<Groogy>
eh no idea
<Groogy>
just curioous what are you trying to accomplish?
<oprypin>
imnotarobot99, do you realize how pointless all of this is? like do you think there will be some user of your program using linux subsystem for windows who cares about some window title?
<oprypin>
Groogy, re: trying to accomplish
<oprypin>
[13:15:34] <oprypin> imnotarobot99, what are you trying to do?
<oprypin>
[13:16:14] <imnotarobot99> im trying out some special characters
<oprypin>
[13:16:45] <oprypin> so you woke up today and went like i wanna try out some special characters today
<oprypin>
[13:17:06] <imnotarobot99> exactly
<Groogy>
well then he is just learnign shit and there's nothing bad about that
<FromGitter>
<sdogruyol> Hey everyone
<imnotarobot99>
what
<Groogy>
Hello @sdogruyol
<FromGitter>
<sdogruyol> How are you
<FromGitter>
<bararchy> Hi @sdogruyol
<FromGitter>
<sdogruyol> Hey
<Groogy>
I need to assign null to a type'd lib on void* but I can't find any way to actually do that :/
<Groogy>
since it is using the "type" keyword it doesn't have anything of Pointer(Void) defined on it
<oprypin>
Groogy, would be nice to report that
<Groogy>
think there already is?
<Groogy>
think saw one weeks ago
<Groogy>
gonna double check
<oprypin>
Groogy, well you can do this but yeah the problem is definitely there https://carc.in/#/r/2eg1
<Groogy>
oh so I could do that for now?
<Groogy>
but yeah will put up a report if I don't find a duplicate
<Groogy>
there we go
pwned has quit [Ping timeout: 268 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
imnotarobot99 has quit [Quit: Page closed]
<oprypin>
is there any way to enumerate the types in a tuple type?
<Groogy>
hmm the types themselves? In a macro or at runtime?
<oprypin>
Groogy, at runtime
<Groogy>
tuple.each { |val| puts val.class } would do it wouldn't it?
<oprypin>
wait what
<oprypin>
what am i missing if it's so simple
<Groogy>
the tuple includes Enumerable so that should work
<oprypin>
actually you know what? i'd prefer to get the compiletime type
<oprypin>
but I don't think a macro is applicable
<Groogy>
hmm that's trickier but you should be able to do for; end on a tuple in a {% %} macro
<oprypin>
a = {1, "a"} - how to get these types?
<oprypin>
if i have it not as a literal
<Groogy>
a = create_random_tuple()
<Groogy>
kind of thing and you want to know what the type of a[0] is?
<oprypin>
for array i have this btw `def type_to_sig(type : Array(T).class) : String forall T ; "a" + type_to_sig(T) ; end`
<oprypin>
Groogy, i want to know the type of a[0], a[1], ...
<Groogy>
so you want this but to return the union type instead right?
<oprypin>
yeah I want a compiletime failure if there's a union anywhere in the tuple which will be ensured by calling a non existent type_to_sig method
<oprypin>
Groogy, no this is just what i want. i just call type_to_sig on every tuple member. the catch is that we still dont have the number of items
<Groogy>
you could create a validator function that takes the specific types you approve of
<Groogy>
a bit C++ over it but should work
<oprypin>
I approve a tuple as long as it contains only the exect types that i have
<Groogy>
it's how I translate between my own serialization and whatever I choose to output to (in this case YAML)
<Groogy>
though that's translation not validation :/
<Groogy>
but yeah if you have a seperate function to validate it, that should work. Because if you don't make the argument a union, it won't allow passing a union to it
<oprypin>
Groogy, mhm seems this validation is difficult
<oprypin>
i'd prefer to have a way to iterate over compile time types in a tuple
<oprypin>
then someone changed documentation to what's actually happening without checking if it makes any sense?
<oprypin>
this is the fancy template magic [16:52:01] <oprypin> for array i have this btw `def type_to_sig(type : Array(T).class) : String forall T ; "a" + type_to_sig(T) ; end`
<w-p>
also, this apparently works: <obj>.pretty_inspect
<oprypin>
nice
A124 has quit [Quit: '']
A124 has joined #crystal-lang
tzekid has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest13273
pwned has joined #crystal-lang
snsei has joined #crystal-lang
raz has quit [Ping timeout: 258 seconds]
raz has joined #crystal-lang
raz has joined #crystal-lang
raz has quit [Changing host]
snsei has quit [Remote host closed the connection]
tzekid has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 276 seconds]
<Groogy>
huh, arrays in Crystal don't implement a #include? method?
<Groogy>
ah nvm it's in enumerable
Guest13273 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest6808
Groogy has quit [Quit: WeeChat 1.9]
rohitpaulk has quit [Ping timeout: 240 seconds]
maa1 has joined #crystal-lang
<maa1>
hi
<maa1>
I have a question
<maa1>
hi internet
<maa1>
:)
<maa1>
:(
<w-p>
ask away dude
<maa1>
:)
<maa1>
What's crystal use cases?
maa1 has quit [Ping timeout: 260 seconds]
pwned has quit [Ping timeout: 255 seconds]
<FromGitter>
<watzon> What's the best way to handle a milti-dimensional array type wise? I can't really do `arr = [] of Array(Array(Int32) | Int32) | int32` because that only handles one level. I need basically need a recursive type or an `Array(Any)`
<FromGitter>
<watzon> I found #3031, but has anyone found any workarounds?
<oprypin>
watzon, a N-dimensional array would just be how many times Array is repeated - Array(Array(Array(z)))
<oprypin>
i dont think you want Array(Int32) | Int32 anywhere there - it would be unusable even if it worked
<oprypin>
what are you trying to accomplish?
<oprypin>
you could imlpement `MultiDimensionalArray(T, N)` if you really wanted but yeah
<FromGitter>
<watzon> Basically I'm trying to recreate `numpy.zeros` where you can give it a sequence of arbitrary length and it will recursively generate a narray for you.