Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:39
    HertzDevil synchronize #11647
  • 14:44
    HertzDevil edited #12173
  • 14:42
    HertzDevil labeled #12176
  • 14:42
    HertzDevil labeled #12176
  • 14:42
    HertzDevil labeled #12176
  • 14:42
    HertzDevil opened #12176
  • 13:41
    Blacksmoke16 unlabeled #4380
  • 13:41
    Blacksmoke16 labeled #4380
  • 13:41
    Blacksmoke16 labeled #12175
  • 13:41
    Blacksmoke16 labeled #12175
  • 13:32
    asterite opened #12175
  • 13:09
    asterite synchronize #12174
  • 12:30
    Blacksmoke16 labeled #12174
  • 12:30
    Blacksmoke16 labeled #12174
  • 12:10
    asterite opened #12174
  • 10:29
    straight-shoota milestoned #12173
  • 10:24
    HertzDevil labeled #12173
  • 10:24
    HertzDevil opened #12173
  • 08:51
    straight-shoota closed #12156
  • 05:47
    HertzDevil labeled #10795
Kirk Haines
@wyhaines
Thanks. My daughter interrupted me to move the van, and you finished for me. :)
Ali Naqvi
@naqvis
:P
Kirk Haines
@wyhaines
@ryanprior:matrix.org are you the current maintainer of crystal-readline? I have a private fork of it that I have been forced to maintain because the mainline lacks proper Crystal 1.0+ support. If I provide a PR, can we get the mainline project updated and a new release built?
ryanprior
@ryanprior:matrix.org
[m]
I'm not the maintainer but that would be useful for me too
Kirk Haines
@wyhaines
OK. I saw a commit from you on the main repo, so I was wondering.
Holden Omans
@kalinon
Anyone know how to build with -Dpreview_mt in the alpine-build docker image?
George Dietrich
@Blacksmoke16
try in the nightly image
3 replies
crystal-lang/distribution-scripts#63 was merged recently but not sure if it's actually in the nightly image atm or if there's another step that needs done to enable it
Holden Omans
@kalinon
oh nice ill try it out
didactic-drunk
@didactic-drunk
Is there a macro or easy way I can store the caller of .newfor reference later in finalize to track potential API misuse? I would prefer easy single line way to add this to any class
Kirk Haines
@wyhaines

@didactic-drunk that complete functionality doesn't exist so far as I am aware, but all of the building blocks exist. Maybe it can be my macro-hacking project of the week to build it.

Right now I am picturing something such as simple as include CallTrace, followed by an annotation on top of any method that one want's to build a call tracing stack for.

The actual call trace would be accessible at any time.

Jonathan Silverman
@mixflame
hello guys... this code pings out on Rizon (Ping Timeout) after it joins the #8chan channel... I asked in #Help on Rizon but I'll post the code here in case anyone wants to try to find the issue.... it has to do with the level of chatting... I suspect I need a "spawn" somewhere. https://gist.github.com/mixflame/e4bc13dd5d9a73af1524b2fe52c430a6
note that rizon is a custom network with special requirements that other networks don't possess.... like pinging on connect... might look wrong for other networks or just be fine... not sure about IRC internals as much as others might be
if you want to use it to build a bot, go ahead, it's based on the irc lib for crystal on github
be aware of the ping issue and if you find a solution let me know
Matthew Berry
@mattrberry
How do you properly case over a runtime type of an object? https://carc.in/#/r/bc3v
George Dietrich
@Blacksmoke16
Matthew Berry
@mattrberry
Ah
Thank you
I feel like mine should still work though
Or am I misunderstanding something?
(sorry for sending 4 messages when I could have sent 1 lol)
Also as a side note, I feel like we shouldn't need to include A as one of the branches of the case since it cannot have an instantiation at runtime
Quinton Miller
@HertzDevil
George Dietrich
@Blacksmoke16
Is nothing preventing you or someone else to extend it and break it
Quinton Miller
@HertzDevil
well you definitely cannot omit A.class for the original snippet because A is indeed an instantiation of A.class
Matthew Berry
@mattrberry
Ah, gotcha
If I wanted to check the runtime type of an object in my example there, but I defined === on A, how would I go about doing that? Or would I just have to use a conditional expression to check the class?
George Dietrich
@Blacksmoke16
sure you want === and not ==?
Matthew Berry
@mattrberry
I don't actually have a use-case for it
I'm just wondering
George Dietrich
@Blacksmoke16
=== should only be needed if you need custom case equality logic
it might just work tbh, like see the the when value is a type as the compiler expands it to is_a?
Matthew Berry
@mattrberry
Oh does the compiler special-case that?
George Dietrich
@Blacksmoke16
i think so yea
be easy enough to try
Matthew Berry
@mattrberry
Yeah seems like it does
Only other thing then would be that this should technically be able to compile I believe, since foo.is_a? cannot be an A, right? https://carc.in/#/r/bc45
Quinton Miller
@HertzDevil
that's what that rfc discusses
Matthew Berry
@mattrberry
Ah gotcha, thank you
George Dietrich
@Blacksmoke16
well technically foo.is_a? A would be true in either case
since its a parent to both
Ali Naqvi
@naqvis
true, case will end on the very first match, so for such scenario its better to move the parent or more general type to the end
bovepm
@bovepm
hi there! former rubyist and crystal newbee here. I am currently writing some crystal code and wanted to use the mixin Enumerable on class level rather than on instance level (see code below). any hints?
https://carc.in/#/r/bc7v
erdnaxeli
@erdnaxeli:cervoi.se
[m]
just extend it: https://carc.in/#/r/bc7z
bovepm
@bovepm
super, thanks for the quick reply
Thore Bödecker
@foxxx0
Hi, any suggestions on how I would best implement a predefined set of format strings / placeholders that can be user-specified (e.g. via config file)? I don't want allow users to directly influence the #sprintf formatstring for security reasons, I was thinking more in the direction of having something like "some prefix: ###foo.attr1### with ###foo.attr2###" where I want to replace "###foo.attr1###" with the value of foo.attr1 and so on. How could achieve that somewhat elegantly?
Ali Naqvi
@naqvis
@foxxx0 Crystal doesn't support RTTI, that means there is no way to achieve dynamic execution of props/methods. Crystal expects methods/fields calls to be known at compile time. What I understand from your context is you are looking for some template language which you can invoke at run-time
12 replies
Thore Bödecker
@foxxx0
correct