willl has quit [Quit: Connection closed for inactivity]
ozra has joined #crystal-lang
jdjkelly has joined #crystal-lang
ozra has quit [Ping timeout: 246 seconds]
bcardiff has joined #crystal-lang
jdjkelly has quit [Ping timeout: 246 seconds]
luislavena has joined #crystal-lang
sailorswift has joined #crystal-lang
bcardiff has quit [Ping timeout: 252 seconds]
NeverDie has joined #crystal-lang
unshadow has joined #crystal-lang
unshadow has quit [Client Quit]
bcardiff has joined #crystal-lang
jdjkelly has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
zamith has joined #crystal-lang
<zamith>
waj: Having everything on github has a problem of discoverability, which I tried to mitigate with crystalshards, but still is not optimal, because of how github search works
<zamith>
rubygems.org can know a lot more about a gem than crystalshards can
<zamith>
not sure if that's something you're considering or not, but felt might be interesting to throw out there
<zamith>
just saw that you meantioned it early, sorry
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blue_deref has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
sailorswift has joined #crystal-lang
<BlaXpirit>
zamith, i was so impressed when i edited description of my project and it was immediately updated on crystalshards
willl has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<nahtnam>
You know what would be cool? If rubygems worked out of the box with this.
miah has quit [Ping timeout: 264 seconds]
miah has joined #crystal-lang
<jhass>
Crystal is not a Ruby implementation
<thor77>
but it looks like
<jhass>
only on the very very surface
zipR4ND has joined #crystal-lang
zamith has quit [Quit: Be back later ...]
<zipR4ND>
hey all, is there a crystal equivalent to the subclass method of ruby?
<jhass>
I'm not aware of any subclass method in ruby
<zipR4ND>
hmm, ok just found it in the code
<zipR4ND>
i just want to know wheter an Object is Class or SubClass < Class ..
<zipR4ND>
i mean: Klass or SubKlass < Klass
<zipR4ND>
given Klass is a Class
<jhass>
obj.is_a?(Klass) && obj.class != Klass
<zipR4ND>
ah, thank you !
<jhass>
though to be honest having to do that check feels pretty smelly
<nahtnam>
jhass: I know its not, but since the syntax is very similar, would it break?
<nahtnam>
I would assume you would only need to make minor adjustments
<jhass>
nahtnam: yes, I bet you won't find an existing 100loc Ruby script that will work unmodified
<jhass>
rubygems uses marshal, so that on its own...
<nahtnam>
jhass: In that case, why not script everything in ruby, and then when ready for production compile it into crystal with minor changes so its x times faster
<havenwood>
nahtnam: Now a Crystal extension for a RubyGem, that you can do.
<havenwood>
nahtnam: And you can embed mruby in Crystal.
<jhass>
nahtnam: that was the initial plan. Guess why it's no longer
<nahtnam>
jhass: No idea?
<jhass>
because it's way too hard to achieve and very slow to compile if you get even half way there
<nahtnam>
jhass: Why not let *me (the programmer) do the conversion?
<nahtnam>
It shouldnt be that hard right?
<jhass>
nahtnam: go ahead, port rubygems then
<jhass>
then we'll talk again
<willl>
why script things in ruby in the first place? crystal compiles an entire program in about the time ruby takes to boot up and parse the ruby script
luislavena has quit [Remote host closed the connection]
<nahtnam>
jhass: Lol, I want talking about rubygems. Just applications in general
<nahtnam>
like a small irc bot or something
<jhass>
nahtnam: again, use the language for a while and then we'll talk again
<nahtnam>
Kk
<nahtnam>
Cya
<nahtnam>
Ill be back soon :P
luislavena has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<zipR4ND>
jhass: and how can i determine if SubKlass is a direct child of Klass?
<jhass>
jeez your design sounds awful :P
<jhass>
mmh
<zipR4ND>
are you talking to me?
<jhass>
don't think we got ancestors yet
<jhass>
yes
<jhass>
>> Int32.superclass
<DeBot>
jhass: Error in line 4: undefined method 'superclass' for Int32:Class - http://carc.in/#/r/793
<zipR4ND>
hmm, i am porting a ruby project
<zipR4ND>
i'm not the designer, more of a translator :) works pretty well btw.
<jhass>
>> class Class; macro def superclass : Class; {{@type.superclass}}; end; end; Int32.superclass == Int
<DeBot>
jhass: Error in line 4: expected 'superclass' to return Class, not Int:Class - http://carc.in/#/r/794
<jhass>
>> class Class; macro def superclass : Class.class; {{@type.superclass}}; end; end; Int32.superclass == Int
<zipR4ND>
i am inside a macro inherited block and want to do things based in the question of wheter this class inherits directly from the class i am defining or from a subclass ...
<zipR4ND>
so i need this info at compile time, not runtime
<jhass>
ah, that makes it easier
<jhass>
just use {{@type.superclass}}
<zipR4ND>
ok thanks, i try
<jhass>
mh, does inherited even fire for subsubclasses?
<zipR4ND>
i very much hope so
<jhass>
>> class Foo; macro inherited; puts {{@type.name}}; end; class Bar < Foo; end; class Baz < Bar; end;
<DeBot>
jhass: Syntax error in eval:11: expecting identifier 'end', not 'EOF' - http://carc.in/#/r/796
<zipR4ND>
and i think so
<jhass>
>> class Foo; macro inherited; puts {{@type.name}}; end; end; class Bar < Foo; end; class Baz < Bar; end;