ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <oprypin:matrix.org> @mixflame: yea but you dont have correct syntax for a Proc
<FromGitter> <oprypin:matrix.org> always needs to be `-> (request : SomeType) {`
<FromGitter> <mixflame> adding a type gets me ```
<FromGitter> <mixflame> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60a4589611fe9c1aa46fedbd]
<FromGitter> <mixflame> how do I add the proper type to the proc input type?
<FromGitter> <oprypin:matrix.org> @mixflame: you have an array of procs that take no args and return nil but you're trying to add a proc with args
<FromGitter> <oprypin:matrix.org> how do u create `@injectors` now
<FromGitter> <mixflame> this is what i have so far
<FromGitter> <mixflame> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60a45c3847884a0443f04d4d]
<FromGitter> <mixflame> this is error
<FromGitter> <mixflame> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60a45c4e47884a0443f04dad]
<FromGitter> <oprypin:matrix.org> @mixflame: we could try going somewhere with this but it's just not possible to operate if ⏎ `request = { :verb.to_s => req["verb"], :path.to_s => req["path"], :headers.to_s => headers, :body.to_s => req["body"], }` ⏎ -- that is the root of your problems
<FromGitter> <oprypin:matrix.org> each value in this hashtable causes the hashtable to have more and more possible types
<FromGitter> <oprypin:matrix.org> you have no ability to call `req["verb"]` and definitely get a string and you also have no ability to call `req["headers"]` and definitely get a Hash(String)
<FromGitter> <oprypin:matrix.org> these are runtime-specific matters
<FromGitter> <oprypin:matrix.org> so you end up "fine, all values can be either a String or a Hash(String)"
<FromGitter> <oprypin:matrix.org> so your http verb can be a Hash(String), as far as the compiler is concerned. does that sound acceptable?
<FromGitter> <mixflame> oh
<FromGitter> <mixflame> yeah i think
<FromGitter> <oprypin:matrix.org> well it shouldn't be acceptable xD
<FromGitter> <mixflame> i'm trying to port this ruby library that I use for processing transactions
<FromGitter> <mixflame> the code isn't mine
<FromGitter> <mixflame> it's just ruby_codemod'd crystal
<FromGitter> <oprypin:matrix.org> why dont you try `record Request, verb : String, path : String, headers : Hash(String, String), body : String)`
<FromGitter> <oprypin:matrix.org> https://crystal-lang.org/api/1.0.0/toplevel.html#record(name,*properties)-macro
<FromGitter> <mixflame> k
<FromGitter> <oprypin:matrix.org> you generally won't be able to get anything usable out of such a transpiler. `Hash` will be the most typical problem. just change it to a typed structure, then some problems will sort themselves out
<FromGitter> <oprypin:matrix.org> then i believe it will just be `@injectors : Proc(Request, String)`
<FromGitter> <mixflame> i gave up on the translation, thanks for the help tho @oprypin:matrix.org
Andriamanitra has quit [Ping timeout: 250 seconds]
Andriamanitra has joined #crystal-lang
deavmi_ has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
chachasmooth has quit [Ping timeout: 250 seconds]
chachasmooth has joined #crystal-lang
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 268 seconds]
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 252 seconds]
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 240 seconds]
f1refly has quit [Read error: Connection reset by peer]
f1refly has joined #crystal-lang
Flipez has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
hendursaga has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
<FromGitter> <mixflame> i got it working
<FromGitter> <mixflame> Paypal Checkout v2 API with Crystal
<FromGitter> <naqvis> πŸ‘
<repo> please consider migrating from freenode
<FromGitter> <erdnaxeli:cervoi.se> i would wait a bit before :)
<repo> yeah sure, libera.chat is not yet open for public
<repo> but should be in a matter of hours/days
<FromGitter> <erdnaxeli:cervoi.se> more on this https://gist.github.com/shadowcat-mst/998cea12794768bdb3da2daeff31baad
sagax has quit [Ping timeout: 252 seconds]
DTZUZU_ has quit [Ping timeout: 240 seconds]
DTZUZU_ has joined #crystal-lang
<FromGitter> <confact> Does it exist some shortcut for uri regex like ruby's `URI::DEFAULT_PARSER.make_regexpΒ΄? Would save some time.
DTZUZU_ has quit [Ping timeout: 240 seconds]
DTZUZU_ has joined #crystal-lang
<FromGitter> <kingsleyh> afternoon
<FromGitter> <kingsleyh> is there any way to make the crystal tool format - not format something? like how ameba has #ignore kind of things
<FromGitter> <Blacksmoke16> no
<FromGitter> <kingsleyh> ok thanks
<FromGitter> <Blacksmoke16> the solution is to just accept what the formatter\ does
<repo> libera.chat is up \o/
<FromGitter> <kingsleyh> I'm using CRZ and it has a macro with a notation for <= which doesn't line up
<Stephie> i got the channel on libera.chat in case there's any movement on moving over
<repo> Stephie: sweet!
<Stephie> would rather i have it as former core team than someone else :)
<FromGitter> <eliasjpr> Is there any Oracle db adapter for Crystal?
<FromGitter> <eliasjpr> I looked in shards.info but found nada πŸ˜’
<Stephie> i doubt it
<Stephie> the overlap between oracle and crystal users is probably tiny so far
<FromGitter> <naqvis> @eliasjpr you can use ODBC (https://github.com/naqvis/crystal-odbc)
<FromGitter> <eliasjpr> Thank you @QbicFox
PixeLInc has joined #crystal-lang
wmoxam has quit [Quit: leaving]
<willamin> kingsleyh: crystal tool format has an --exclude flag
<willamin> oh :facepalm: I guess that's for excluding files, but you probably wanted excluding format rules
avane has left #crystal-lang ["Leaving"]
<FromGitter> <speg> Is there a way to get the number of rows in a DB::ResultSet? I only see `#column_count` but nothing for rows.
<FromGitter> <kingsleyh> yeah I just wanted to exclude some methods from the formattter
<FromGitter> <Blacksmoke16> @speg a result set represents a single row, so it has no way of knowing about how many total rows there are/may be
sagax has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 260 seconds]
DTZUZU_ has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 260 seconds]
DTZUZU_ has joined #crystal-lang
<FromGitter> <speg> @Blacksmoke16 oh? but it has an `#each` method? πŸ˜•
<FromGitter> <Blacksmoke16> oh wait you're right. It represents a the result of a query, not a specific result
<FromGitter> <Blacksmoke16> assuming the iteration is not lazy prob would be doable to expose that, guess it would depend on the specific db driver implementation
<raz> sigh, has anyone followed the freenode drama. should we switch servers? https://gist.github.com/joepie91/df80d8d36cd9d1bde46ba018af497409
<Stephie> needs bringing up to core team if the new channel gets advertised elsewhere, and help from oprypin for the bridge bot
<Stephie> decision isnt up to me, but i reserved the channel on the new network anyway
<raz> yea, i have no opinion on it, just wanted to mention in case it was missed. seems to be a big deal
<Stephie> i have an opinion on it i just cant do anything about it :P
<raz> another nail in the coffin of irc i'm afraid, yet more fragmentation
DTZUZU has joined #crystal-lang
<straight-shoota> yeah
<Stephie> its always been like this
<Stephie> its been worse
<Stephie> irc still isnt dead
<FromGitter> <oprypin:matrix.org> ^
<straight-shoota> but freenode is really a staple, having it fall isn't very good for anyone
<FromGitter> <oprypin:matrix.org> i think it is the nail in the coffin indeed
<Stephie> i doubt freenode will like, shut down any time soon
<FromGitter> <tenebrousedge> it sounds like things will continue as normal on the new domain, but it is sad that this is happening
<straight-shoota> of course not
<Stephie> just a bunch of movement
<straight-shoota> but movement creates friction, that's basic physics :D
<Stephie> and yet still nobody has made anything better than IRC :P
DTZUZU_ has quit [Ping timeout: 240 seconds]
<Stephie> matrix is messy, buggy, a bit slow, and far too complex
<Stephie> xmpp mucs are buggy so people only use it for one to one chat
<Stephie> or small chats
<Stephie> gitter... exists
<raz> nowadays you could run freenode on a $5 digital ocean VPS anyway. all this drama over a domain name it seems
<raz> yes, gitter exists, that is the other problem :<
<FromGitter> <oprypin:matrix.org> where's the problem
<Stephie> there isnt one with gitter existing
<raz> right, it's more with people actually using it :p
<Stephie> i didnt say that either
<Stephie> only that its not taking over irc any time soon
<straight-shoota> it's disappointing that the most frequented community chat currently is actually discord *rofl*
<Stephie> is ti?
<Stephie> there's an active official discord now?
<Stephie> or you mean just, in general
<Stephie> not for cr
<straight-shoota> no for crystal
<straight-shoota> well, not sure if it is to be considered really official
<raz> oh crystal has a discord? i can actually tolerate that
<FromGitter> <oprypin:matrix.org> ok just shut this place down geez
<raz> not as nice as irc, but probably the second least bad
<FromGitter> <oprypin:matrix.org> *anyway*... matrix can do everything irc can, whats the big deal
<raz> the clients were bad last i checked
<FromGitter> <oprypin:matrix.org> still better experience than irc
<raz> well, maybe matrix then. i'm mostly lurking lately anyway. i'll wait and see where destiny leads us
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 260 seconds]
<f1refly> oprypin: despite your agressive and disrespectful behaviour, please consider that people have different tastes and needs. for me, and likely multiple others, weechat is the alltime favorite chat program, current matrix clients cant keep up with ti
<FromGitter> <oprypin:matrix.org> f1refly, i think you misunderstood my tone. and now i see how it can easily be misunderstood. sorry about that.
<sorcus> f1refly: where you see agressive behaviour?
<FromGitter> <oprypin:matrix.org> you also have to keep in mind that i was always supporting IRC, while it was still reasonable. and running the bridge bot, of course
<f1refly> well, his messages basically boils down to "irc sucks your opinion is wrong"
<FromGitter> <tenebrousedge> that's not what I got from that
<f1refly> yeah, sure. freenode is not the whole irc though. irc is still very reasonable, i'm currently connected to five networks using different nicks
<f1refly> it's not all bad, theres good people and interesting discussion
<FromGitter> <tenebrousedge> Cool, glad you enjoy IRC
<FromGitter> <MrSorcus> 😸
<FromGitter> <oprypin:matrix.org> f1refly, to be fully clear. my message "ok just shut this place down geez" is supposed to have the exact opposite meaning. it is me being disheartened that there's another person who may choose a separate community in Discord over this chat
<f1refly> yeah, i didn't intend to offend you, just wanted to point out that it's not all horrible and people still enjoy themselfes
<FromGitter> <MrSorcus> Go live in peace πŸ€—
f1refly has quit [Quit: see ya in hell]
repo is now known as himselforama
himselforama has quit [Killed (beckett.freenode.net (Nickname regained by services))]
PixeLInc has quit [Ping timeout: 260 seconds]
PixeLInc has joined #crystal-lang
jrayhawk has quit [Ping timeout: 260 seconds]
early has quit [Ping timeout: 260 seconds]
baweaver has quit [Ping timeout: 260 seconds]
justinmcp_ has quit [Ping timeout: 260 seconds]
^ has quit [Ping timeout: 260 seconds]
johnny101 has quit [Ping timeout: 260 seconds]
snapcase has quit [Ping timeout: 260 seconds]
^ has joined #crystal-lang
justinmcp has joined #crystal-lang
snapcase has joined #crystal-lang
early has joined #crystal-lang
baweaver has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
fifth has joined #crystal-lang
fifth has quit [Quit: WeeChat 3.1]
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
fifth has joined #crystal-lang
hendursaga has quit [Quit: hendursaga]
hendursaga has joined #crystal-lang
hsh has joined #crystal-lang
hsh has quit [Client Quit]
HumanG33k has quit [Max SendQ exceeded]
sorcus has quit [Ping timeout: 260 seconds]
<FromGitter> <Daniel-Worrall> Late to the party, but the crystal discord server is not official, but it's a nice community