jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | 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
r0bby has quit [Ping timeout: 260 seconds]
r0bby has joined #crystal-lang
aquijoule_ has joined #crystal-lang
woodruffw has quit [Ping timeout: 260 seconds]
deavmi has quit [Ping timeout: 268 seconds]
deavmi has joined #crystal-lang
woodruffw has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 258 seconds]
chachasmooth has quit [Ping timeout: 264 seconds]
chachasmooth has joined #crystal-lang
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 240 seconds]
teardown_ has joined #crystal-lang
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 240 seconds]
teardown_ has joined #crystal-lang
teardown_ has quit [Remote host closed the connection]
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
chovy has joined #crystal-lang
<chovy> is there a good cross platform gui tool kit?
<chovy> i want to build a simple desktop app for win/mac/linux
postmodern has joined #crystal-lang
<chovy> man nothing on udemy for crystal programming language
repo has quit [Ping timeout: 272 seconds]
repo has joined #crystal-lang
<oprypin> lol
<chovy> is this language going to take off?
<postmodern> shardbox.org really needs a "Parser Generator" category. Was trying to research which parser libraries are popular. All I know is Pegasus. Not sure if there's any bison/flex crystal adaptations.
<chovy> parsing what?
<postmodern> text :P
<postmodern> i'm my case i was considering sending a PR to json_path.cr, to parse JSON Path expressions into a proper AST of Nodes, instead of what it currently does: https://github.com/lribeiro/json_path.cr/blob/master/src/json_path.cr
<chovy> oh
<chovy> nm. can't help you
<chovy> is there a css selector parser for crystal?
<FromGitter> <Dan-Do> @chovy try this https://github.com/naqvis/crystal-html5
hightower2 has quit [Read error: Connection reset by peer]
straight-shoota has quit [Quit: ZNC 1.7.5 - https://znc.in]
straight-shoota has joined #crystal-lang
_ht has joined #crystal-lang
hightower3 has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<straight-shoota> postmodern, the category structure isn't very though out yet. just send a PR against https:://github.com/shardbox/catalog
HumanG33k has quit [Quit: Leaving]
HumanG33k has joined #crystal-lang
<FromGitter> <jrei:matrix.org> hum, it is said the data structure is immutable https://github.com/crystal-lang/crystal/blob/master/src/log/metadata.cr - it is not really true
<FromGitter> <jrei:matrix.org> the `defrag` method mutates it, that's why it can't be a struct
<FromGitter> <jrei:matrix.org> it might be possible using generics, and maybe macros
hightower3 has quit [Ping timeout: 246 seconds]
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<FromGitter> <asterite> Wow, that code is so unsafe... I wonder why.
<FromGitter> <jrei:matrix.org> @asterite: because of https://github.com/crystal-lang/crystal/pull/9295
postmodern has quit [Quit: Leaving]
<FromGitter> <jrei:matrix.org> I've digged a bit using a struct + simple Array
deavmi has quit [Quit: Eish! Load shedding.]
<FromGitter> <jrei:matrix.org> I think the same, it should be possible to do something safer
deavmi has joined #crystal-lang
HumanG33k has quit [Ping timeout: 260 seconds]
<raz> dabbled with rust some more. still not a fan, but cargo is really amazing.
<FromGitter> <HertzDevil> woah it looks like nobody tried to write immutable/persistent data structures for crystal
hightower3 has joined #crystal-lang
hightower3 has quit [Ping timeout: 260 seconds]
<FromGitter> <asterite> There's https://github.com/lucaong/immutable
<FromGitter> <jrei:matrix.org> very nice, starred
<FromGitter> <jrei:matrix.org> that's a detail, strange to use classes for the immutables objects like Map and Vector
<FromGitter> <jrei:matrix.org> that's copy on write :)
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
teardown has quit [Ping timeout: 240 seconds]
teardown has joined #crystal-lang
f1reflyylmao is now known as f1refly
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <watzon> Is there a more convenient way to concatenate bytes slices than writing them to an IO? Because I haven't been able to find one, but creating an `IO::Memory` every time I want to add a couple slices together is getting annoying.
<FromGitter> <watzon> I know a more performant thing would also probably be to create an empty byte slice and memcopy the other slices to it, but meh
<oprypin> just gang up on the bug tracker
<oprypin> it really really should have concatenation ability
<FromGitter> <watzon> I agree. It's not a plain pointer, it knows it's size. No reason it shouldn't be able to.
<FromGitter> <watzon> Do you know if there's an existing issue for this?
<oprypin> i dont know. haventheard of one, anyway
<FromGitter> <watzon> I'll go search and make one if there isn't one
<oprypin> thx
<FromGitter> <watzon> So apparently the rationale is "we have IO for that"
<oprypin> very disappointed. i am 100% sure that is wrong
<oprypin> Python even has feature parity between its equivalent of slice and string
<FromGitter> <watzon> I'll create another issue to reopen the discussion and link you to it for your thoughts. I think it's stupid personally.
<FromGitter> <watzon> I'm actually porting a python library right now which is what brought up the issue in the first place
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
<oprypin> obskyr is somewhat high-profile. seems like they got turned off by something
<FromGitter> <watzon> Honestly this has been one of my main problems with Crystal lately is how quickly new ideas seem to get shut down, a lot of the time without any real discussion. From the get-go a core maintainer will be like "well I don't like this" and then others jump on board, someone says "this isn't a priority", and the issue gets closed. When I initially started getting involved in the community some 5 years ago it seemed
<FromGitter> ... a bit more welcoming, but now I can't tell you how many people I've talked to that have been turned off of the language simply because they felt unwelcome. Obskyr's issue history is a perfect example of that.
<FromGitter> <watzon> Nim and Zig have the exact opposite thing going on. Ideas definitely get shut down, and often, but at least there's a real discussion where people feel like they're being heard.
HumanG33k has quit [Remote host closed the connection]
<FromGitter> <Daniel-Worrall> Feels like there's a lot of discussion going unshared in the private core dev chat rooms
<FromGitter> <watzon> Same
<FromGitter> <watzon> This is all very disappointing to me for several reasons, the core one being that I still love the language and want it to succeed. It's hard to succeed in isolation, and it's hard to succeed when you're ostracizing community members that are trying to do their best to help make the language better.
<FromGitter> <Blacksmoke16> i mean, got a recent example of a new idea being shut down without discussion?
<straight-shoota> ^ would be interested in that, too
<straight-shoota> I really have a different perception, that lot's of ideas are hanging in limbo and no-one decides whether to go on or drop it
<FromGitter> <Blacksmoke16> ^, thats what i see more of too
<yxhuvud> would be really nice to have a release though. Half a year without a release is too long, regardless of if they want the next to be 1.0 or not. RCs would be fine in that case, just release something.
<straight-shoota> definitely
<FromGitter> <Blacksmoke16> theres a PR for it created like a month ago
<FromGitter> <Blacksmoke16> :/
ua has quit [Ping timeout: 264 seconds]
<FromGitter> <Blacksmoke16> almost 2 now*
<FromGitter> <watzon> That's another issue. Looking for a more recent example of what I was talking about. Obskyr's issues are pretty good examples, but maybe it's just my perception based on what I find every time I search for an issue and find that it already exists and was already closed. What would be nice to have is a voting system for issues so we can get a feel for what the community as a whole actually wants. Github issues
<FromGitter> ... aren't great at that, even with reactions.
<FromGitter> <Blacksmoke16> i wouldnt call those recent tho, and they all have 10+ comments
<FromGitter> <Blacksmoke16> its not like it was "i dont like this", (close)
<FromGitter> <watzon> https://github.com/crystal-lang/crystal/issues/9673 this is a good example actually. There's been more than a few times I've been annoyed with the built in string manipulation methods myself, including camelcase.
<FromGitter> <Blacksmoke16> > Or maybe create a shard for more specific (and performant) string operations.
<FromGitter> <watzon> The "if you don't like it make your own shard" argument is one I've seen a few times. While it might be trivial to roll your own camelcase method, why not try to do it right in the standard library?
<FromGitter> <Blacksmoke16> i guess its a balance of what is useful versus what would just be bloat
<FromGitter> <Blacksmoke16> like the stdlib isnt intended to be "everything you may ever need"
<straight-shoota> thanks for picking one I starred in =)
<straight-shoota> My take is that stdlib should be a sound foundation for most common features and be easy to use
<FromGitter> <watzon> Just happened to be one of the latest closed issues marked with feature request haha
<straight-shoota> I'm totally concinved I shouldn't have closed it right away
<straight-shoota> it realls feels like surpressing discussion
<FromGitter> <Blacksmoke16> fwiw you did close it 3 months after your comment
<straight-shoota> oh, right
<straight-shoota> never mind then :D
<FromGitter> <watzon> I agree with keeping bloat down to a degree, but at the same time this language is meant to be convenient and easy to use. There are also a large number of people that move here from Ruby that are use to a somewhat "bloated" standard library. I just think it would make sense to implement some kind of voting system so we can at least get a sense for how the community at large feels.
ua has joined #crystal-lang
<FromGitter> <Blacksmoke16> possibly, but also would be quite biased imo
<FromGitter> <watzon> Maybe a combination of that and a bot that closes stale issues automatically after giving a warning. That way people can have a chance to get the conversation going again, and if they don't the issue gets closed. Pretty sure Dart and a few other languages I've played with use that.
<FromGitter> <watzon> Biased how?
<FromGitter> <Blacksmoke16> as the saying goes "squeakiest wheel gets the oil"
<FromGitter> <watzon> Well yeah, but usually the squeakiest wheel is the one that needs the oil the most, no?
<FromGitter> <Blacksmoke16> an example would be windows, sure it would be nice to have (as would prob a large portion of people), but to me personally i dont really care about it as i dont use windows
<FromGitter> <Blacksmoke16> id rather work on an annotation refactor
<FromGitter> <watzon> Obviously the people actually writing the code would get final say on what gets implemented, but it would be a better way to get a feel for what the community wants. Github issues can be intimidating.
<FromGitter> <Blacksmoke16> but in the end there isn't really a need as its open source
<FromGitter> <Blacksmoke16> its not like you can force a non core dev to work on something other people voted on
<FromGitter> <watzon> @Blacksmoke16 same, but currently there's no way to know how many people actually want Windows support. I imagine there are quite a few, but it's hard to gauge just based off the issues.
<FromGitter> <Blacksmoke16> pretty sure its the most 👍 issue
<FromGitter> <Blacksmoke16> forgot the is:open filter
<FromGitter> <Blacksmoke16> im hoping there'll be more of a roadmap after 1.0.0 is released
<FromGitter> <Blacksmoke16> as i imagine brian and other manas core devs are focusing on that
<FromGitter> <Blacksmoke16> from there you could have like "this is what we want to get done in Q1 2021" then could have a voting thing to determine the priority
<FromGitter> <watzon> That would be a nice thing to have
<FromGitter> <watzon> Since we'll be hitting v1.0 it would be great to get an actual release schedule
<straight-shoota> i know they have used such plans at manas internally
<straight-shoota> and shared with the core team
<straight-shoota> but yeah, making these things public and possibly getting more people involved would be great
<FromGitter> <watzon> Exactly. I don't understand keeping it all private. This is an open source project with a pretty nice community, it would make sense to share things and enlist support. Could probably get things done a lot faster.
* FromGitter * Blacksmoke16 would sponsor https://github.com/crystal-lang/crystal/issues/9802 :p
<straight-shoota> there's currently only https://github.com/crystal-lang/crystal/wiki/Roadmap and it really hasn't evolved significantly in the past three years or so
<FromGitter> <watzon> Honestly an annotation rework would be tops for me too
<FromGitter> <watzon> They need a little TLC
<FromGitter> <Blacksmoke16> that, #8148, #9246, and #8835 and my top picks ;P
<DeBot> https://github.com/crystal-lang/crystal/issues/8148 (Specify annotation targets) | https://github.com/crystal-lang/crystal/issues/9246 (Add `ASTNode.warning` macro method) | https://github.com/crystal-lang/crystal/issues/8835 ([RFC] Macro Defs - Methods in Macro land)
<straight-shoota> #9246 really should be easy to do
<DeBot> https://github.com/crystal-lang/crystal/issues/9246 (Add `ASTNode.warning` macro method)
<straight-shoota> it just needs some other bugs figs to be useful
<FromGitter> <watzon> Man I'd still love to be able to actually traverse and modify the AST at compile time like you can do with Nim rather than just some rudimentary codegen. A man can dream.
<FromGitter> <Blacksmoke16> yea, #7147 and #7394
<DeBot> https://github.com/crystal-lang/crystal/issues/7147 (Macro raise doesn't keep location) | https://github.com/crystal-lang/crystal/issues/7394 (Keep type location when raising inside macro hooks)
<FromGitter> <Blacksmoke16> what ever became of the error handling refactor you were doing?
<straight-shoota> unfortunately, those bugfixes probably require some more extensive refactoring
<straight-shoota> hah, yeah
<straight-shoota> I postponed it because I figured it wouldn't fit into 1.0
<straight-shoota> initially, I thought it would be a big change, but not actually hard to do. But devil is in the details. Lot's of code depends on current quirky behaviour
<straight-shoota> In retrospec, I probably should've continued with it and it would have fit very well in the time frame since we still haven't reached 1.0
<FromGitter> <Blacksmoke16> at this rate we'll get to 2.0 first
<straight-shoota> rofl
<straight-shoota> might be an intersting swing
<FromGitter> <oz:matrix.org> this makes me think that maybe Crystal could have something like Nim's fusion repository to "stage" new ideas before they could be added (or not) to the stdlib?
<FromGitter> <mattrberry> Is it known that runtime exceptions don’t always point to the place they happened when compiled for release? It makes debugging my emulator tricky when I get an arithmetic overflow and can’t even tell which file it’s from :p
<FromGitter> <watzon> Might not be a bad idea
<FromGitter> <Blacksmoke16> compile with `--debug`?
<straight-shoota> mattrberry, the problem is that release builds are highly optimized and lots of function calls may just be inlined, so it's not straightforward to get accurate backtraces
<FromGitter> <Blacksmoke16> wouldnt that be https://forum.crystal-lang.org/c/crystal-contrib/6 ?
<FromGitter> <Blacksmoke16> > Related to language, compiler, tools and standard library. Let’s talk about how/if something should be added/changed/removed.
<straight-shoota> it's basically an extended stdlib
<FromGitter> <mattrberry> @Blacksmoke16 Isn’t the —debug flag on my default, even in release? That was my understanding, but I’m not at my computer atm
<FromGitter> <mattrberry> @straight-shoota That makes sense :/ I wish my gba emulator could run at full speed when not in release, because otherwise it takes ages to get to the point that it crashes :p
<FromGitter> <watzon> Yes but also no. That's just a place for dicsussion, what @oz:matrix.org is talking about is an actual branch that's purpose built for testing potential changes. Kind of like Rust's nightly builds.
<straight-shoota> nice proposal :+1:
<FromGitter> <watzon> Gracisa
<FromGitter> <watzon> Lma. Gracias.
<FromGitter> <watzon> This is what I get for not sitting down to type.
<straight-shoota> maybe try tts
<straight-shoota> eh other way round
<straight-shoota> speach recognition
<FromGitter> <jrei:matrix.org> the example looks fragile
<FromGitter> <watzon> Lol. Well I'm on my laptop, but I'm sure I could find something.
<FromGitter> <watzon> @jrei:matrix.org how so?
<FromGitter> <jrei:matrix.org> having to do all this `[i..i]`, quite tedious and easy to make a mistake
<FromGitter> <jrei:matrix.org> with slice concatenation it will become simpler hopefully
<straight-shoota> if Slice#[]= with range was supported, you could do something like this
<straight-shoota> `aes_key = sha_256a.dup[8..24] = sha256b[8..24]`
<FromGitter> <watzon> That would be a nice thing to have as well
<straight-shoota> it's in the same ballpark as +
<FromGitter> <jrei:matrix.org> or, using `+=`
<straight-shoota> or maybe not, it should be mutating
<FromGitter> <jrei:matrix.org> I think, first split the shas, then concat, to make it clear
<FromGitter> <watzon> Yeah I definitely agree that any methods that are generally self-mutating should be left out
<straight-shoota> general suggestion: `auth_key[x..(x + 36)]` could be `auth_key[x, 36]`
<FromGitter> <watzon> If we can decide on exactly what we want implemented I can submit a PR to get things moving. I don't imagine it would take more than an hour worth of work to get the concatenation methods added and tests written.
<FromGitter> <watzon> @straight-shoota ahh you're right. Translating some of this from Python, so there's definitely some cleanup to do.
<straight-shoota> yeah, implementation shouldn't be hard at all
<FromGitter> <jrei:matrix.org> Slice#concat(*slices) can be very useful
<FromGitter> <jrei:matrix.org> not take just one, but multiples
<FromGitter> <Blacksmoke16> `Slice.join(*slices)`
<FromGitter> <watzon> Tbh even `IO::Memory` having a constructor that accepts multiple byte slices would be acceptable to me, but I feel like that's mostly just useful in my current situation.
<FromGitter> <jrei:matrix.org> @Blacksmoke16: yes but no, the point is to keep an existing slice and grow it
<FromGitter> <Blacksmoke16> arent slices structs tho?
<FromGitter> <watzon> @Blacksmoke16 better
<FromGitter> <watzon> Yessir
<FromGitter> <Blacksmoke16> so id think it would work like `Time`. I.e. you get a new slice that is `*slices` merged into one
<FromGitter> <jrei:matrix.org> yes, but I expect Slice.join creating a new buffer
<FromGitter> <jrei:matrix.org> not mutating the first one
<FromGitter> <Blacksmoke16> right, thats what it would do
<FromGitter> <jrei:matrix.org> IO::Memory mutates its internal buffer
<FromGitter> <jrei:matrix.org> so, performance wise, better using IO::Memory than using Slice.join
<FromGitter> <watzon> Yeah, it would create a new buffer that's the size of the combined size of all the other slices, and then copy those slices into it using `Slice#copy_to` I imagine.
<FromGitter> <jrei:matrix.org> that's why I like `Slice#concat`, but `Slice#+` can be useful too
<FromGitter> <watzon> Well `IO::Memory` and `Slice.join` would both have to create a new buffer though, no? Unless you already had the `IO::Memory` and you're adding to it.
<straight-shoota> alternative: `[slice1, slice2, slice3].sum` =)
<FromGitter> <oz:matrix.org> (just a small thing, but `key[x..(x + 10)] != key[x, 10]`)
<FromGitter> <watzon> @straight-shoota just as an Array method that returns a Slice?
<FromGitter> <jrei:matrix.org> hum, there is `Hash#mere(**other)` but no `Array#concat(*other)`...
<straight-shoota> @watzon: Enumerable#sum
<straight-shoota> @oz:matrix.org oops n - 1 error
<FromGitter> <watzon> Ahh yeah, you're right
<FromGitter> <watzon> @straight-shoota I would see that as a reasonable compromise if the core team doesn't want to add the Slice methods for whatever reason. Not as pretty, but at least it works.
<straight-shoota> when Slice gets #+, it should also get .additive_identity (after #10151 is merged)
<DeBot> https://github.com/crystal-lang/crystal/pull/10151 (Add identity methods for #sum and #product)
<straight-shoota> Enumerable#sum would just be a byproduct, I'd still have something like concat
<FromGitter> <watzon> Ahh nice
<FromGitter> <watzon> I was gonna say, both would be better haha
<straight-shoota> as in an explicit API
<FromGitter> <jrei:matrix.org> after thinking more, adding `IO::Memory#write(*slices)` will some your verbosity issue @watzon:
<FromGitter> <jrei:matrix.org> really, the difference between the two examples is one operation per line vs multiple operations per line
<straight-shoota> still, I don't think you should be bothered to create an IO if you just want to concatenate some slices
<straight-shoota> it's a different mental model, and yes you can bend to make it work, but having a clean and concise way is better
<FromGitter> <watzon> I agree completely. Until then I'm monkey patching `IO::Memory.new` to accept multiple slices as an input, and that should cut down on verbosity, but I'd love to have slice concatenation.
<FromGitter> <jrei:matrix.org> maybe, but with Slice#+ lots of intermediary slices will be created
<FromGitter> <jrei:matrix.org> `one + two + three` == `((one + two) + three)` . Here, one intermediary slice. And will go up if more concat is done
<oprypin> > when Slice gets #+, it should also get .additive_identity
<oprypin> no it shouldnt O_o
<FromGitter> <Blacksmoke16> what about `slice1 + 12_u8` :trollface: l
<FromGitter> <Blacksmoke16> does that add a byte on the end and return a new slice?
<oprypin> >> "aa".to_slice + 12_u8
<DeBot> oprypin: from ??? - https://carc.in/#/r/a6ws
<oprypin> >> "aaaaaaaaaaaaaaaaaaaa".to_slice + 12_u8
<DeBot> oprypin: # => Bytes[97, 97, 97, 97, 97, 97, 97, 97] - https://carc.in/#/r/a6wt
<oprypin> already taken
<straight-shoota> @jrei:matrix.org: There's also `String#+` even if you could just use a IO::Memory to save intermediaries
<FromGitter> <jrei:matrix.org> so, @Blacksmoke16 's proposal of `Slice.join(one, two, three)` is not bad, but will be like `IO::Memory.write(one, two, three)`
<straight-shoota> and there's even a convenient syntax using string interpolation
<FromGitter> <jrei:matrix.org> yes, String.build and/or interpolation
<straight-shoota> oprypin there can be both `+(offset : Int)` and `+(other : self)`
<FromGitter> <jrei:matrix.org> I'm for Slice#+, just, no sure about if it will solve correctly the issue
<FromGitter> <Blacksmoke16> probably should go back and add some of this discussion to that ticket
<straight-shoota> could we have a Gitter to GitHub bot for that? :D
<straight-shoota> should just append a compact summary of this chat discussion to the issue
<FromGitter> <jrei:matrix.org> bad idea I jsut got: `Slice.build do |io|`...
<FromGitter> <jrei:matrix.org> hum, the element web is no really responsive - not sure why
<FromGitter> <Blacksmoke16> @straight-shoota `if language.in? "cr", "crystal"` 😉
<straight-shoota> either work
<straight-shoota> I'd definitely use `in?` for more cases
<FromGitter> <watzon> Rather than `{"cr", "crystal"}.includes?(language)`?
<FromGitter> <watzon> I actually didn't realize there was an `Object.in?` that accepts a collection
<straight-shoota> it's rather recent addition
<straight-shoota> and really convenient
<FromGitter> <watzon> No kidding. I've been wanting that for some time
<FromGitter> <watzon> Python has it and it's great
deavmi_ has joined #crystal-lang
deavmi has quit [Ping timeout: 260 seconds]
<FromGitter> <watzon> I wish you could monkey patch structs
<FromGitter> <Blacksmoke16> why cant you?
_ht has quit [Remote host closed the connection]
<FromGitter> <watzon> Oh maybe you can? I tried it before and was running into errors, but now it's working.
<FromGitter> <watzon> I guess I just fucked up before
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <watzon> Might be a way to improve it, but https://carc.in/#/r/a6x0
<oprypin> watzon, ` offset = i * s.size` is wrong
<oprypin> should just be `ptr += s.size` anyway
<Andriamanitra> watzon: python's "x in arr" is just a nice way to say "arr.__contains__(x)" and not a real method like Object#in?
<FromGitter> <watzon> `in` in python is an operator which basically searches a collection for an object. So it's very similar, but they are different since `in` is a built-in in Python.
<FromGitter> <watzon> Thanks @oprypin, didn't even realize that `Pointer` has a `+=` op
<oprypin> watzon, in crystal `+=` is always `=` and `+` (unlike in python with its list extend trap, grumble grumble)
<Andriamanitra> it's just a matter of perspective which one you consider a trap.. python's __iadd__ gives you the performance you'd expect from in-place addition
<oprypin> i have .extend for that, thanks
<Andriamanitra> and i have x = y + z for the other thing :p
<oprypin> enjoy writing a[x] = a[x] + [y]
<Andriamanitra> that's modifying original a anyway?
<oprypin> it's not modifying original underlying a[x] which is a list
<Andriamanitra> fair enough
<hightower2> watzon nice that you took the effort to reopen += thing
<hightower2> thanks
<FromGitter> <watzon> carc.in really needs to be updated to support the if suffix syntax. `foo = bar if baz` leads to it thinking the indentation level should be elevated.
<FromGitter> <Daniel-Worrall> test
Nekka has left #crystal-lang ["Leaving"]
<FromGitter> <Daniel-Worrall> test 2
Nekka has joined #crystal-lang
<FromGitter> <Daniel-Worrall> oops
<hightower2> Hey could help me review a macro... I have these two macros which work: https://carc.in/#/r/a6y3
<hightower2> But they fail if the function to be aliased ends with =... https://carc.in/#/r/a6y6
<hightower2> I'm not sure where/what exactly needs to be adjusted
<oprypin> hightower2, try `{{new_method.symbolize}}`
<hightower2> not much difference I think, https://carc.in/#/r/a6yf
<oprypin> hightower2, oh shoot, actually `{{m.name.symbolize}}` is what needs that treatment
<oprypin> pls ping me for quicker turnaround
<hightower2> I seem to have got it working with: https://carc.in/#/r/a6yx
<oprypin> .symbolize is correct, dont add : like that
<hightower2> (well it's still an error, but about the args thing rather than the syntax, which is a different/easily solvable issue)
<hightower2> yes, but if I use :symbolize then some weird stuff happens
<oprypin> mabe not using it correctly
<oprypin> agh needs `new_method.id.symbolize`
<FromGitter> <Daniel-Worrall> Hmm Why can't we do hashes as `{k: v}`?
<oprypin> Daniel-Worrall, thats the syntax for namedtuple. need something else. that is =>
<hightower2> oprypin, yes, that's what I use, but it puts the name in quotes... https://carc.in/#/r/a6z8
<hightower2> aha actually that's fine
<hightower2> I missed to realize it's good. thank you
<FromGitter> <Daniel-Worrall> right