Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:07
    Blacksmoke16 labeled #12783
  • 00:07
    Blacksmoke16 labeled #12783
  • Nov 26 23:55
    carlhoerberg opened #12783
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 02:15
    straight-shoota assigned #11331
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota opened #12782
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota opened #12781
  • Nov 25 23:01
    straight-shoota synchronize #11635
  • Nov 25 22:56
    straight-shoota synchronize #11840
  • Nov 25 22:49
    straight-shoota labeled #12636
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota opened #12780
  • Nov 25 19:11
    straight-shoota labeled #12779
George Dietrich
@Blacksmoke16
in this case you'd prob want to use super
From IRC (bridge bot)
@FromIRC
<xyhuvud> FileDescriptor implements it by itself though
George Dietrich
@Blacksmoke16
it's implemented via the include Crystal::System::FileDescriptor
so ends up not being a redefinition
From IRC (bridge bot)
@FromIRC
<mikko> well this is a fun bug crystal-lang/crystal#2485
<mikko> my almost trivial code has been compiling for many minutes due to this line: StaticArray(Bool, 10_000).new(true)
George Dietrich
@Blacksmoke16
nice
is there a reason to have a 10k member static array tho?
From IRC (bridge bot)
@FromIRC
<mikko> i was just wanting to experiment with bitarray vs staticarray vs array
<mikko> trying to see what kind of performance i get with each
George Dietrich
@Blacksmoke16
fair enough
Kirk Haines
@wyhaines
I think that if you search the archives in here, you will find some other discussion of StaticArray and that compilation performance cost. I remember seeing it....a yearish-ish ago.
didactic-drunk
@didactic-drunk
@Blacksmoke16 super doesn't work. https://carc.in/#/r/bj9h
George Dietrich
@Blacksmoke16
welp
Quinton Miller
@HertzDevil
Lewis E. Bogan
@lebogan

@Blacksmoke16 and all who responded to my raspberry pi madness: I finally got 1.0 to compile on a model 4b with 4gb ram. Why? Why not. After setting al the environment stuff, it works like a charm. I did have to compile llvm-10 for the rpi which was 'painfull' - almost 10 hours! I kept notes if anyone is interested - I consolidated a lot of stuff from online plus community help. A big thanks to everyone

Crystal 1.0.0 ()

LLVM: 10.0.0
Default target: arm-unknown-linux-gnueabihf

Still missing the compile date, but it works along with shards 0.15.0.

Benjamin Wade
@RespiteSage
@lebogan Very cool! I'm glad you got it working.
Taupiqueur
@alexherbo2
I think I found a bug in File.match?
File.match? accepts a String or Path as path, but match_single_pattern only accepts String
George Dietrich
@Blacksmoke16
im assuming you get compile time error if you try and use a Path
Taupiqueur
@alexherbo2
yep
it's how I discovered the bug
George Dietrich
@Blacksmoke16
prob just need to do path.to_s
didactic-drunk
@didactic-drunk
Def#args.splat is broken for def a(*, b = false)? https://carc.in/#/r/bjhj
8 replies
oprypin
@oprypin:matrix.org
[m]

even if you have *args it just comes up as args, so not sure if you'd be able to tell that arg is a splat. so think this could deff be improved a bit

that just points to it not being meant for this use case

George Dietrich
@Blacksmoke16
shouldnt you be able to construct the same def with the ASTNode representation of it? Which atm that's not possible
as it turns out you can use this to know that something is a splat arg
From IRC (bridge bot)
@FromIRC
<raz> grkek: yo, how do i enable request logging in grip?
George Dietrich
@Blacksmoke16
traitor :P
From IRC (bridge bot)
@FromIRC
<raz> heh
<raz> i just want to scribble something up quick, athena too heavy
George Dietrich
@Blacksmoke16
lies
George Dietrich
@Blacksmoke16
working a new validation constraint tho
AVD::Constraints::File.new max_size: "5M", mime_types: ["application/pdf", "text/plain"] :0
and a similar one for images
From IRC (bridge bot)
@FromIRC
<raz> yeh, just wrote my own logger middleware. still quicker than remembering all::the::AVDs :⁠P
George Dietrich
@Blacksmoke16
request logging is enabled by default, so wouldnt have had to do anything ;)
From IRC (bridge bot)
@FromIRC
<raz> yeh, next time i need aircraft carrier framework i'll use athena again :⁠D
George Dietrich
@Blacksmoke16
heh
George Dietrich
@Blacksmoke16
George Dietrich
@Blacksmoke16
should Char define a to_u8! method that delegates to #ord so that you can do like Bytes['G', 'I', 'F']?
George Dietrich
@Blacksmoke16
well ord.to_u8
guess it wouldnt work for all chars so prob not worth it
From IRC (bridge bot)
@FromIRC
<alekhine> I'm a sort-of beginner. If I want to learn crystal, should I just go and learn Ruby first?
<alekhine> Hello everyone, btw
George Dietrich
@Blacksmoke16
i wouldn't then you'd have to unlearn a bunch of stuff :wink:
From IRC (bridge bot)
@FromIRC
<alekhine> Gotcha. Are there any decent resources yet?
George Dietrich
@Blacksmoke16

Is it broken, or is it just the way it is that an "*" arg is nameless?

class C
  def a(*, b = false)
    puts "a"
  end

  macro redef(name)
    {% meth = @type.methods.select { |m| m.name == name }.first %}
    def {{meth.name}}({{meth.args.map {|arg| arg.name.id != "" ? arg : "*".id }.splat}})
      puts "redef"
      previous_def
    end
  end

  redef "a"
end

C.new.a

You can detect that empty state. Are there any other cases where the name is blank?