jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.15.0 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
ozra has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Philpax has quit [Read error: No route to host]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
willl has quit [Quit: Connection closed for inactivity]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
Philpax has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
Philpax has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
Philpax has quit [Ping timeout: 260 seconds]
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
pabs has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
trapped has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
mark3 has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
Philpax has quit [Ping timeout: 260 seconds]
bam0 has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
brunto has joined #crystal-lang
brunto has quit [Quit: Lost terminal]
brunto has joined #crystal-lang
brunto_ has joined #crystal-lang
brunto has quit [Client Quit]
brunto_ has quit [Client Quit]
brunto has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
brunto_ has joined #crystal-lang
Dreamer__ has joined #crystal-lang
asterite_ has joined #crystal-lang
acetoxy_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
brunto has quit [*.net *.split]
bam0 has quit [*.net *.split]
maxpowa has quit [*.net *.split]
iamstef has quit [*.net *.split]
acetoxy has quit [*.net *.split]
Dreamer3 has quit [*.net *.split]
fmcevoy has quit [*.net *.split]
toydestroyer has quit [*.net *.split]
trajing has quit [*.net *.split]
fnux has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
asterite has quit [*.net *.split]
asterite_ is now known as asterite
maxpowa has joined #crystal-lang
iamstef has joined #crystal-lang
daemonwrangler has joined #crystal-lang
bam0 has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
brunto_ has quit [Ping timeout: 244 seconds]
Kilo`byte has quit [Ping timeout: 268 seconds]
Philpax has quit [Read error: Connection reset by peer]
Kilo`byte has joined #crystal-lang
Philpax has joined #crystal-lang
Liothen has quit [Ping timeout: 268 seconds]
brunto has joined #crystal-lang
soveran has joined #crystal-lang
Liothen has joined #crystal-lang
brunto has quit [Ping timeout: 268 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
brunto has joined #crystal-lang
trapped has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
jeromegn has quit [Read error: Connection reset by peer]
jeromegn has joined #crystal-lang
jhass has quit [Ping timeout: 264 seconds]
braidn has quit [Ping timeout: 264 seconds]
pleiosaur has quit [Ping timeout: 264 seconds]
Netfeed has quit [Ping timeout: 264 seconds]
grindhold_ has joined #crystal-lang
justinmcp has joined #crystal-lang
grindhold has quit [Ping timeout: 264 seconds]
DeBot has quit [Ping timeout: 264 seconds]
justinmcp_ has quit [Ping timeout: 264 seconds]
pleiosaur has joined #crystal-lang
<crystal-gh> [crystal] ssvb opened pull request #2446: Promote results of +-*|&^ operations to 64-bit if any operand is 64-bit (master...20160413-fix567) https://git.io/vVhMp
jhass has joined #crystal-lang
g3funk has joined #crystal-lang
Netfeed has joined #crystal-lang
<travis-ci> MakeNowJust/crystal#aecd022 (master - Compiler: fixed bug related to module types): The build passed. https://travis-ci.org/MakeNowJust/crystal/builds/122764628
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 248 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Netfeed has joined #crystal-lang
Netfeed has quit [Changing host]
Philpax__ has joined #crystal-lang
bcardiff has joined #crystal-lang
Philpax_ has quit [Ping timeout: 248 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
broz has joined #crystal-lang
brunto_ has joined #crystal-lang
swav_ has joined #crystal-lang
rolha has joined #crystal-lang
grindhold has joined #crystal-lang
benner has joined #crystal-lang
_kfpratt has joined #crystal-lang
brunto_ has quit [Ping timeout: 252 seconds]
g3funk has quit [*.net *.split]
grindhold_ has quit [*.net *.split]
brunto has quit [*.net *.split]
kfpratt has quit [*.net *.split]
ssvb has quit [*.net *.split]
swav has quit [*.net *.split]
benner_ has quit [*.net *.split]
swav_ is now known as swav
braidn_ has joined #crystal-lang
brunto has joined #crystal-lang
<rolha> hi everyone
ssvb has joined #crystal-lang
<rolha> I'm trying to port some python code of mine to crystal, and I needed to implement something like this: http://deeplearning.net/software/theano/library/tensor/basic.html#theano.tensor.switch
<rolha> basically switch(condition, iftrue, iffalse)
<rolha> but condition, iftrue and iffalse would be chunks of arbitrary code
<rolha> as an example, let's say (ignoring the invalid syntax)
<rolha> switch({ random() < 0.5}, {0.0}, {1.0})
<rolha> but random would be called every time I call switch
<rolha> is this something I can do easily with blocks?
bcardiff has joined #crystal-lang
Philpax__ has quit [Ping timeout: 248 seconds]
pabs has quit [Ping timeout: 248 seconds]
sandelius has joined #crystal-lang
pabs has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<BlaXpirit> rolha, sure
<BlaXpirit> chances are it's valid syntax even
<BlaXpirit> hmm some more details would help
<BlaXpirit> rolha, why not just do switch { random() < 0.5 }
<BlaXpirit> >> [1,2,3,4].map { |x| random() < 0.5 ? x : 0 }
<BlaXpirit> DeBot pls
<rolha> BlaXpirit: thanks!
<rolha> it's possible to hardcode the iftrue and iffalse, but it's nice to have the freedom to specify them. They might not be constants, they might another random generator
<rolha> *be
<rolha> the code builds a simulation model, and it's nice a nice API to add a variable in that fashion, say: model.add_variable(:x, switch({y < 10.0}, {4.0}, {z + 1}) etc...
<rolha> but it's just the original API I'm following, I guess in the first pass I'll just "translate" the code, they I'll make it more idiomatic perhaps (once it's working...)
<rolha> *then
DeBot has joined #crystal-lang
<jhass> rolha: I think you're looking for proc (lambda) literals
<jhass> they're a bit verbose in crystal
<jhass> as you need to specify the types of the arguments
<rolha> jhass, thanks! I still need to get my head around the difference between blocks, procs and lambdas
<jhass> well Crystal makes no difference between proc or lambda (Ruby does however)
<jhass> you could also consider an OOP based design by capturing and converting blocks to procs, say switch { random() < 0.5 }.on_success { 4.0 }.on_failure {|z| z + 1 }
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<asterite> rolha: a small macro might be useful here :-) https://play.crystal-lang.org/#/r/wjy
<asterite> Or even more natural using new: https://play.crystal-lang.org/#/r/wjz
soveran has joined #crystal-lang
brunto has quit [Quit: leaving]
<rolha> asterite, that's great, thanks! I really need to learn more about macros
kfpratt has joined #crystal-lang
mark3 has quit [Remote host closed the connection]
rolha_ has joined #crystal-lang
daemonwrangler_ has joined #crystal-lang
braidn_ has quit [*.net *.split]
_kfpratt has quit [*.net *.split]
rolha has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
willl has joined #crystal-lang
daemonwrangler_ is now known as daemonwrangler
g3funk has joined #crystal-lang
bcardiff has quit [Ping timeout: 250 seconds]
broz has quit [Remote host closed the connection]
Rinkana has joined #crystal-lang
broz has joined #crystal-lang
bam0 has quit [Ping timeout: 244 seconds]
broz has quit [Ping timeout: 248 seconds]
sandelius has joined #crystal-lang
sandelius has quit [Client Quit]
soveran_ has joined #crystal-lang
soveran is now known as Guest17544
Guest17544 has quit [Ping timeout: 250 seconds]
soveran_ is now known as soveran
soveran has quit [Changing host]
soveran has joined #crystal-lang
broz has joined #crystal-lang
broz has quit [Remote host closed the connection]
broz has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
Excureo has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
Excureo has joined #crystal-lang
rolha_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rolha has joined #crystal-lang
rolha has quit [Client Quit]
tomchapin has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #2443: Implemented the new "global" type inference algorithm (master...feature/2390_ivars) https://git.io/vVF42
tilpner_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vweku
<crystal-gh> crystal/master 249b4ea Ary Borenszweig: Compiler: fixed bug related to rescue and is_a?. Fixes #1988
tilpner has quit [Ping timeout: 244 seconds]
tilpner_ is now known as tilpner
<travis-ci> crystal-lang/crystal#98783b2 (master - Merge pull request #2443 from crystal-lang/feature/2390_ivars): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122850984
Renich has joined #crystal-lang
<travis-ci> crystal-lang/crystal#249b4ea (master - Compiler: fixed bug related to rescue and is_a?. Fixes #1988): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122852232
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vwe3n
<crystal-gh> crystal/master 3f5feda Ary Borenszweig: Compiler: fixed bug related to rescue and break inside while. Fixes #2441
pawnbox has joined #crystal-lang
broz has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 260 seconds]
tilpner has quit [Quit: :wq]
<travis-ci> crystal-lang/crystal#3f5feda (master - Compiler: fixed bug related to rescue and break inside while. Fixes #2441): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122857894
tilpner has joined #crystal-lang
broz has joined #crystal-lang
pabs has quit [Ping timeout: 276 seconds]
danzilio has quit [Ping timeout: 252 seconds]
TheLemonMan has joined #crystal-lang
ssvb has quit [Ping timeout: 252 seconds]
pleiosaur has quit [Ping timeout: 252 seconds]
steenuil has quit [Ping timeout: 252 seconds]
ldlework has quit [Ping timeout: 252 seconds]
pabs has joined #crystal-lang
pleiosaur has joined #crystal-lang
danzilio has joined #crystal-lang
ldlework has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vwe8R
<crystal-gh> crystal/master eba4985 Ary Borenszweig: Compiler: removed Virtual ASTNode (T+) from syntax
ssvb has joined #crystal-lang
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vwe05
<crystal-gh> crystal/master d1e2460 Ary Borenszweig: Compiler: disallow casting to Object and Reference (yet). Fixes #2403
pawnbox has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#d1e2460 (master - Compiler: disallow casting to Object and Reference (yet). Fixes #2403): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122870946
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vwe2u
<crystal-gh> crystal/master 9e60e6a Ary Borenszweig: Compiler: fixed bug related to closured untyped variables. Fixes #2196
broz has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vweVm
<crystal-gh> crystal/master c20ff92 Ary Borenszweig: Compiler: disallow casting to Class. Fixes #1995
pawnbox has quit [Ping timeout: 244 seconds]
<travis-ci> crystal-lang/crystal#9e60e6a (master - Compiler: fixed bug related to closured untyped variables. Fixes #2196): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122876251
broz has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pleiosaur has quit [*.net *.split]
pabs has quit [*.net *.split]
DeBot has quit [*.net *.split]
jhass has quit [*.net *.split]
asterite has quit [*.net *.split]
wmoxam has quit [*.net *.split]
matp has quit [*.net *.split]
dzv has quit [*.net *.split]
waj has quit [*.net *.split]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vwer5
<crystal-gh> crystal/master 2fb98ff Ary Borenszweig: Fixed typo [ci skip]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vweoa
<crystal-gh> crystal/master e7fdf60 Hamdi Akoğuz: Fix sigfault error in XML::Node#namespace_scopes method....
<crystal-gh> crystal/master 4d903a2 Ary Borenszweig: Merge pull request #2445 from Hamdiakoguz/xml_namespace_scopes_error...
pabs_ has joined #crystal-lang
trajing has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #2237: allow reject/select to receive arrays (master...array-args-for-select-reject) https://git.io/v2gmb
fmcevoy has joined #crystal-lang
pleiosau1 has joined #crystal-lang
waj- has joined #crystal-lang
pleiosaur has joined #crystal-lang
pabs has joined #crystal-lang
DeBot has joined #crystal-lang
matp has joined #crystal-lang
jhass has joined #crystal-lang
asterite has joined #crystal-lang
dzv has joined #crystal-lang
wmoxam has joined #crystal-lang
waj has joined #crystal-lang
wmoxam_ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#4d903a2 (master - Merge pull request #2445 from Hamdiakoguz/xml_namespace_scopes_error): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122881694
jhass|off has joined #crystal-lang
pleiosaur has quit [*.net *.split]
pabs has quit [*.net *.split]
DeBot has quit [*.net *.split]
jhass has quit [*.net *.split]
asterite has quit [*.net *.split]
wmoxam has quit [*.net *.split]
matp has quit [*.net *.split]
dzv has quit [*.net *.split]
waj has quit [*.net *.split]
asterite has joined #crystal-lang
jhass|off is now known as jhass
AckZ has quit [Ping timeout: 248 seconds]
AckZ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#ccf872e (master - Merge pull request #2237 from plukevdh/array-args-for-select-reject): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/122882029
DeBot has joined #crystal-lang
matp has joined #crystal-lang
dzv has joined #crystal-lang
mgarciaisaia1 has joined #crystal-lang
pawnbox has joined #crystal-lang
DeBot has quit [Ping timeout: 240 seconds]
dzv has quit [Ping timeout: 240 seconds]
matp has quit [Ping timeout: 240 seconds]
mgarciaisaia1 has quit [Quit: Leaving.]
pawnbox has quit [Ping timeout: 276 seconds]
dzv has joined #crystal-lang
matp has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
leafybas- has joined #crystal-lang
Dreamer3 has joined #crystal-lang
Tophe_ has joined #crystal-lang
Renich_ has joined #crystal-lang
Dreame___ has joined #crystal-lang
Excureo has quit [Remote host closed the connection]
ldleworker has joined #crystal-lang
pawnbox has joined #crystal-lang
omninonsense has joined #crystal-lang
broz has quit [Remote host closed the connection]
waj- has quit [*.net *.split]
ldlework has quit [*.net *.split]
Renich has quit [*.net *.split]
Dreamer__ has quit [*.net *.split]
leafybasi has quit [*.net *.split]
Dreamer3_ has quit [*.net *.split]
[spoiler] has quit [*.net *.split]
Tophe has quit [*.net *.split]
waj has joined #crystal-lang
Rinkana has quit [Read error: Connection reset by peer]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
pawnbox has quit [Ping timeout: 260 seconds]
broz has joined #crystal-lang
Renich_ has quit [Quit: leaving]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
soveran has quit [Remote host closed the connection]
broz has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran_ has joined #crystal-lang
wmoxam_ has quit [Ping timeout: 264 seconds]
pleiosau1 has quit [Ping timeout: 264 seconds]
wmoxam has joined #crystal-lang
soveran_ has quit [Remote host closed the connection]
soveran has quit [Ping timeout: 264 seconds]
dzv has quit [Ping timeout: 264 seconds]
dzv has joined #crystal-lang
pleiosaur has joined #crystal-lang
pawnbox has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
DeBot has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
A124 has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 248 seconds]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] skunkworker opened pull request #2448: Changed Crypto::Subtle.constant_time_compare to return a boolean. (master...add_string_secure_compare) https://git.io/vwvco
pawnbox has quit [Ping timeout: 250 seconds]