Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:47
    straight-shoota closed #12051
  • 13:47
    straight-shoota closed #12050
  • 12:17
    beta-ziliani edited #7318
  • May 15 08:43
    r00ster91 closed #7318
  • May 15 08:17
    r00ster91 closed #7690
  • May 14 17:01
    Blacksmoke16 labeled #11995
  • May 14 13:03
    webhive closed #12055
  • May 14 10:19
    straight-shoota milestoned #12051
  • May 14 10:00
    I3oris edited #12051
  • May 14 08:45
    oprypin review_requested #11977
  • May 13 23:29
    Blacksmoke16 unlabeled #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 opened #12061
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota opened #12060
Cris Ward
@crisward
@sdogruyol If you build crystal with llvm 5.0, but sure to share your findings. Especially if it doubles compile speed :wink:
From IRC (bridge bot)
@FromIRC
* cptaffe sent a long message: cptaffe_2017-09-09_23:26:18.txt https://matrix.org/_matrix/media/v1/download/matrix.org/tfLzsYfBzDtBnCGwjpzwVZhI
<cptaffe> DATABASE is an instance returned by DB.open and given a string (it's valid, I've connected with psql)
<cptaffe> Url::paginate_all just calls DATABASE.query("select a, b from foo limit 100 offset 0")
From IRC (bridge bot)
@FromIRC
<cptaffe> Ok, so an exception fired iniside DATABASE's init expression and that's what caused it to segfault. Is this expected behavior?
From IRC (bridge bot)
@FromIRC
<cptaffe> Similar question, has anyone run into crystal-db stalling on an insert ... returning?
Serdar Dogruyol - Sedo セド
@sdogruyol
Morning everyone
unreadable
@unreadable
Morning all
From IRC (bridge bot)
@FromIRC
<cptaffe> Hi
From IRC (bridge bot)
@FromIRC
<Rinkana> Hmm, i'm trying to get something like this working: https://play.crystal-lang.org/#/r/2p64
Bar Hofesh
@bararchy
Well
item.is_a?(item_class)
is not a class
item_class should be a Class or a Generic type
From IRC (bridge bot)
@FromIRC
<Rinkana> Do you know a workaround for it? So the get method returns the class requested or raises
Bar Hofesh
@bararchy
else .is_a?() wont work with it
TBH this: return item if item.is_a?(item_class.class) which seems not to work
not sure whty
From IRC (bridge bot)
@FromIRC
<Rinkana> This seems to work
<Rinkana> However i'm expecting union issues later on.
<Rinkana> Argh, there they are
From IRC (bridge bot)
@FromIRC
<Rinkana> Hmm, i don't want to append .as() to every call.
Vilhelm Sjölund
@VSjolund

Morning all! I'm trying to invoke a getter call to a lazily read property from inside a method call, e.g.

class Recipe
    property recipe_id : Int32
    property ingredients : Array(Ingredient) { Ingredient.find_by(:recipe_id => @recipe_id) }

    def some_method
        ingredients.try &.each do |ingredient|
            # this doesn't yield
        end
    end
end

Anyone knows how to accomplish this?

Vilhelm Sjölund
@VSjolund
Ahh never mind I figured it out >_< I had written @ingredients which doesn't invoke the getter call. The above code works as expected... Sorry for bothering.
From IRC (bridge bot)
@FromIRC
<Rinkana> https://play.crystal-lang.org/#/r/2p6q Oh wow, this works!
From IRC (bridge bot)
@FromIRC
<Groogy> hmm where is the documentation for LibC?
<RX14> Groogy, there is none because its not really meant to be used outside the stdlib
<Groogy> well it's good for binding libraries
<Groogy> and I want to ensure Long is the right size
<RX14> yeah
<RX14> we should really document the types
<RX14> not the functions
<RX14> but probably the typesd
<Groogy> yeah that would be nice
<RX14> thing is that libs can't be documented currently
<RX14> they're always ignored
<Groogy> standard for signed long is at least 32bit
<Groogy> don't know what conditions are for it being bigger though
From IRC (bridge bot)
@FromIRC
<Groogy> ah think I found on intel's webpage the difference
<Papierkorb> Groogy: LibC::Long et al are supposed to mirror the sizes of their C counterparts
<Groogy> yeah so (when windows is supported) it will be 32bit on Windows 64bit but 64bit on Linux/MacOS when the OS is 64 as well
<Groogy> and 32bit when its a 32bit system
<Papierkorb> anything else would at least be a severe bug
<Groogy> yeah I will have to assume it should work like this, though would be nice with some docs on it since its quite useful for doing bindings
<RX14> of course ia-32 and ia-64 are entirely unrelated processor architectures
<RX14> why would intel make it simple
<Papierkorb> ia64 is itanium, not x86