NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
havenwood has joined #crystal-lang
<jhass>
mmh, I'd really like this Ruby pattern to work in Crystal http://carc.in/#/r/6bf
n1ftyn8_ has quit []
n1ftyn8_ has joined #crystal-lang
endou___________ has quit []
endou___________ has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
BlaXpirit has joined #crystal-lang
zz_Cidan is now known as Cidan
Cidan is now known as zz_Cidan
BlaXpirit has quit [Quit: Quit Konversation]
BlaXpirit has joined #crystal-lang
NeverDie has joined #crystal-lang
zodiak has quit [Quit: Leaving]
zz_Cidan is now known as Cidan
_whitelogger has quit [Ping timeout: 252 seconds]
_whitelogger has joined #crystal-lang
Cidan is now known as zz_Cidan
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
DeBot has quit [Client Quit]
DeBot has joined #crystal-lang
shama has joined #crystal-lang
<ozra>
jhass: Though, one of them is a function the other a object bound method... Different types
<jhass>
but same interface
<jhass>
duck typing, you know
<ozra>
No, there's a hidden argument - the method type is really (Size, String -> Int32)
<ozra>
So, statically typed, they definitely difer
<jhass>
I disagree, the caller interface is 100% compatible, the difference is the implementation side, where the implicit self argument isn't received
<jhass>
Proc is more an object representing a function than the actual function
<ozra>
Procs have an implicit class instance? That doesn't rhyme well with performant code. In the "real world", they do differ, and since Crystal compiles to "real world code", the signature are mismatches - if procs don't have implicit empty objects associated of course (which would be strange)
<ozra>
Ofcourse crystal could make it a union type and support is invisibly, so that your way indeed is right, in crystal syntax..
<jhass>
right, I'm talking conceptually here, not implementation wise
<ozra>
Yes, there are two sides, and since Crystal is static.. That's why I brought that up. Otherwise, the way you put is much more elegant (and logical)
zodiak has joined #crystal-lang
<ozra>
Hmm, jhass, is it possible to define functor operator? So that the object becomes a callable?
<jhass>
not that I'm aware of
<jhass>
and I'm still not sure I'd like that
<ozra>
Why?
zodiak has quit [Client Quit]
zodiak has joined #crystal-lang
<jhass>
I'm not sure, it doesn't feel OO to me and Crystal so far feels highly OO to me like Ruby does. But perhaps it's because usually ambiguity between method calls and local variables is resolved through the call syntax, and making locals able to receive the call syntax feels like loosing clarity
zodiak has quit [Client Quit]
<jhass>
foo bar # I can be sure foo is a method call, that would no longer hold true
<jhass>
(that is a method call of a method defined on self)
zodiak has joined #crystal-lang
<ozra>
Fair enuogh. Empirically though, the pattern is used in both JS/LS and C++ extensively without problems. (there are other problems with those languages though ;-). So that fear can be layed aside :)
sfcgeorge has joined #crystal-lang
<ozra>
Let's say I want to mmap 100 files in to mem. If I do this from coroutines, it will all be sequential any way, each waiting on the prior? So I need to use C OS threads to get around the initial IO block of the mapping?
<crystal-gh>
[crystal] asterite pushed 3 new commits to master: http://git.io/vqL1d
<crystal-gh>
crystal/master 8ac88e5 Ary Borenszweig: Fixed #923: Compiler crash on proc assigned to instance variable initialize in a class that is never instantiated
<crystal-gh>
crystal/master 3ce859c Ary Borenszweig: Spec: small fix in expect_raises
<crystal-gh>
crystal/master da52d00 Ary Borenszweig: Fixed #917: disallow declaring a variable multiple times with different types
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: http://git.io/vqLDn
<crystal-gh>
crystal/master e6e36c6 yui-knk: [ci skip] Add comment for Enumerable#inject with initial value