<FromGitter>
<sam0x17> I feel better about not calling concat now tho xD
<FromGitter>
<sam0x17> but yeah if people like `+` being a thing for `Set` I'll submit a PR -- I always end up using it for defining per-character whitelists (handy for the `O(1)` `.includes?`)
<FromGitter>
<Blacksmoke16> is prob what you want actually
<FromGitter>
<Blacksmoke16> which is pretty much what your `+` is doing
<FromGitter>
<sam0x17> ahh
<FromGitter>
<sam0x17> still makes me wonder what they hate about + so much lol
lvmbdv has quit [Ping timeout: 272 seconds]
lvmbdv has joined #crystal-lang
<FromGitter>
<asterite> I think `+` as an alias for `|`, like in Ruby, is probably good. It's an alias but I think `+` is more intuitive than `|`. There's also `Array#+` and `Array#|` with slightly different semantics, so I think `+` for Set is a good addition
<FromGitter>
<sam0x17> @asterite thanks for chiming in -- I'm guessing we also keep `|` for backwards compatibility?
<FromGitter>
<sam0x17> oh alias ok yup
<FromGitter>
<watzon> I'm confused, are we talking about changing the union syntax?
<FromGitter>
<sam0x17> adding a `+` alias for it
<FromGitter>
<sam0x17> and your comment proves that people do use the old syntax
<FromGitter>
<watzon> I didn't even know there was another syntax
<FromGitter>
<sam0x17> there isnt
<FromGitter>
<watzon> Ahh ok, guess this is what I get for jumping in late lol
<FromGitter>
<watzon> Serious confusion
<FromGitter>
<sam0x17> this would be a PR to add `Set.new + Set.new` as the same as `Set.new | Set.new` for example
<FromGitter>
<sam0x17> I didn't even realize the union syntax was already a thing -- had always just monkey-patched in a `+`
<FromGitter>
<watzon> Ahh ok. I didn't know the pipe syntax was even there for adding sets together. The `+` syntax makes more sense,
<FromGitter>
<watzon> I thought we were talking about actual Unions for a bit there
<FromGitter>
<sam0x17> ah ok lol your first comment made it sound like you knew about and used the `|` syntax
<FromGitter>
<sam0x17> ahhhh
<FromGitter>
<sam0x17> gotha
<FromGitter>
<sam0x17> now it makes sense
<FromGitter>
<watzon> Yeah the pipe syntax doesn't make sense to me, `+` makes a lot more sense
<FromGitter>
<sam0x17> the pipe syntax NOW makes some sense to me after this discussion, but I also prefer +
<FromGitter>
<sam0x17> lol
<FromGitter>
<sam0x17> because union really is addition for sets
<FromGitter>
<watzon> Pipes should either be for unions or as a bitwise OR
<FromGitter>
<sam0x17> yeah, I also see them and assume we doing stuff with bits or stuff with types
<FromGitter>
<watzon> Same with `&`
<FromGitter>
<sam0x17> yes
lvmbdv has quit [Ping timeout: 258 seconds]
lvmbdv has joined #crystal-lang
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 245 seconds]
chemist69 has quit [Ping timeout: 264 seconds]
chemist69 has joined #crystal-lang
<FromGitter>
<watzon> Is there an easy way to sent multipart/form-data with the built in `HTTP::Client`?
<FromGitter>
<watzon> I'm use to using Halite, but I'm trying to not have that dependency this time around
<FromGitter>
<sam0x17> but at least that one passes in an io into a multipart form
<FromGitter>
<watzon> It's pretty stupid that it requires passing in a whole request object, but if that's the only way I guess that's the only way
ht_ has joined #crystal-lang
<FromGitter>
<sam0x17> you should look at the source code for the methods/classes you are dealing with -- I had something similar with HTTP::Cookies where it was like the easiest monkey-patch cuz its actually stupid simple under the hood
<FromGitter>
<sam0x17> I was expecting this indecipherable complex thing
<FromGitter>
<sam0x17> a lot of the HTTP classes/structs are just wrappers around simple objects like `Hash` and `Set`
<FromGitter>
<sam0x17> it turns out
<FromGitter>
<watzon> Yeah MIME::Multipart looks like it's a little more complicated
<FromGitter>
<sam0x17> ah I see lol
<FromGitter>
<watzon> It's alright, I'll be fine for now
<FromGitter>
<sam0x17> to be fair, I've never seen multipart uploads be an easy thing in any language
<FromGitter>
<sam0x17> its like everyone designs their API with multipart uploads as a conceptual outlier and then glue it on
ht_ has quit [Quit: ht_]
absolutejam has joined #crystal-lang
<FromGitter>
<absolutejam_gitlab> you know
<FromGitter>
<absolutejam_gitlab> I really don't like that you can access instance vars without `@`
<FromGitter>
<watzon> What do you mean? The only way they should be acceptable without the `@` is as a getter or setter
absolutejam has quit [Ping timeout: 244 seconds]
absolutejam has joined #crystal-lang
<FromGitter>
<absolutejam_gitlab> a property I mean
<FromGitter>
<absolutejam_gitlab> I didnt know it only worked for properties (getters/setters) tbh, I mostly only use properties atm
<FromGitter>
<watzon> Yeah, `getter` and `setter` are really just macros that create basic getter and setter methods. `property` does both. You're not actually accessing the instance variable directly without the `@` and you can emulate the behavior by just creating your own getter/setter methods.
<FromGitter>
<absolutejam_gitlab> I guess it makes sense then
<FromGitter>
<absolutejam_gitlab> since it's calling a method not accessing a ivar
<FromGitter>
<absolutejam_gitlab> so it doesn't need the `@`
<FromGitter>
<watzon> Then there's private getter/setter/property, protected getter/setter/property, and class_ versions of each. So `class_getter`, etc.
<FromGitter>
<watzon> Just in case you don't know. They can all be pretty helpful.
Human_G33k has joined #crystal-lang
<Human_G33k>
hello just a noob question, how crystal is support for old hardware ? i686 to be exact
devil_tux has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter>
<watzon> Good question. I have no idea what the answer is though.
absolutejam has quit [Ping timeout: 268 seconds]
devil_tux has quit [Ping timeout: 268 seconds]
absolutejam has joined #crystal-lang
devil_tux has joined #crystal-lang
sagax has quit [Remote host closed the connection]
ua_ has quit [Ping timeout: 248 seconds]
ua has joined #crystal-lang
<FromGitter>
<kalinon> @Blacksmoke16 looking at your assert lib. very nice. What does `{% verbatim do %}` do? I am not familiar with this macro method.
<FromGitter>
<kalinon> I see it used in the core... but no docs or anything... hmmm
<FromGitter>
<dscottboggs_gitlab> Crystal's ARM support is a little weak afaik at the moment. It looks like crystal itself is currently only released for x86 and x64 (according to the releases page (https://github.com/crystal-lang/crystal/releases)). The compiler does support cross-compilation though...
<FromGitter>
<dscottboggs_gitlab> what does that do?
<FromGitter>
<dscottboggs_gitlab> specifically the second line
<FromGitter>
<j8r> I have a MSI laptop, quite old now (GE60 2PE). They can be bought without an OS
<FromGitter>
<j8r> @dscottboggs_gitlab AFAIK they register the interpreters to run. If the binary is aarch64, they are executed with QEMU
<FromGitter>
<dscottboggs_gitlab> huh. I didn't know you could run containers on other architectures with qemu. That's pretty nifty. I guess I should've figured there was a way considering containerd haha
<FromGitter>
<dscottboggs_gitlab> what do you use the arm-built stuff for, if you don't mind me asking?
<FromGitter>
<j8r> Yep, but this isn't very safe
<FromGitter>
<dscottboggs_gitlab> do you have like a pi cluster or something?
<FromGitter>
<dscottboggs_gitlab> the container you're doing the work in doesn't have `--privileged`, what's unsafe?
devil_tu1 has quit [Ping timeout: 245 seconds]
<FromGitter>
<j8r> the second like, it may mess up the host
<FromGitter>
<j8r> and possibly other containers
<FromGitter>
<dscottboggs_gitlab> ah
<FromGitter>
<dscottboggs_gitlab> probably better just to dedicate a qemu arm vm to it then
<FromGitter>
<j8r> 👍
<FromGitter>
<dscottboggs_gitlab> but then file-sync becomes a bitch.... :(
<FromGitter>
<j8r> compilation is literally 10x slower :/
<FromGitter>
<bcardiff> @Blacksmoke16 from the json output it's not clear if I can get the validation errors of a specific property (for example to show inline errors in a form). And there is a wierd `"@actual": PropertyType` in the second snippet.
<FromGitter>
<Blacksmoke16> `"@actual": PropertyType` is mentioned in the bullet points below. is a helper macro that makes generating the required initializer easier. Would it help if i also added a comment above it?
<FromGitter>
<Blacksmoke16> hmm, and no. that would have to be implemented. if you're doing server rendered forms there would be a way to have access to the failed assertions
<FromGitter>
<Blacksmoke16> there is*
<FromGitter>
<Blacksmoke16> or you could also override the JSON format
<FromGitter>
<bcardiff> @Blacksmoke16 mentioning that is in the roadmap is enough to me :-). ⏎ regarding the initalize macro. you are right, I skip that is was not a `def`. But the quotes and the `@` was really werid to my eyes. I wonder if there is another syntax with a bit less friction.
<FromGitter>
<Blacksmoke16> @bcardiff the custom JSON format is already doable. And my bad, i meant to say there is already a method that returns failed assertions. I added a few sentences for both
<FromGitter>
<Blacksmoke16> ```code paste, see link```
<FromGitter>
<bcardiff> 👍
<FromGitter>
<Blacksmoke16> do you know of any better way for the macro? currently its basically just using a `**args` and doing like `{{key.id}} : {{value.id}}`
<FromGitter>
<Blacksmoke16> which the `@` symbol isnt a valid key
<FromGitter>
<Blacksmoke16> sometimes you also have to quote the body, mostly if using nilable types with default value https://play.crystal-lang.org/#/r/7gs2
<FromGitter>
<Blacksmoke16> the value*
<FromGitter>
<Blacksmoke16> i guess i could add the `@` behind the scenes
<FromGitter>
<Blacksmoke16> would clean it up a bit
<FromGitter>
<Blacksmoke16> imma do that
absolutejam has joined #crystal-lang
sagax has quit [Quit: Konversation terminated!]
sagax has joined #crystal-lang
devil_tux has joined #crystal-lang
absolutejam has quit [Ping timeout: 258 seconds]
devil_tux has quit [Ping timeout: 272 seconds]
Stephie has quit [Quit: Fuck this shit, I'm out!]
Vexatos has quit [Quit: ZNC Quit]
Vexatos has joined #crystal-lang
Stephie has joined #crystal-lang
hightower2 has quit [Ping timeout: 246 seconds]
absolutejam has joined #crystal-lang
sagax has quit [Remote host closed the connection]