sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ssvb has quit [Quit: Leaving]
havenwood has quit [Ping timeout: 265 seconds]
kyrylo has quit [Ping timeout: 240 seconds]
kyrylo has joined #crystal-lang
kyrylo has quit [Ping timeout: 255 seconds]
sailorswift has joined #crystal-lang
blue_deref has quit [Quit: bbn]
havenwood has joined #crystal-lang
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
sailorswift has joined #crystal-lang
havenwood has quit [Ping timeout: 240 seconds]
BlaXpirit has joined #crystal-lang
dbackeus has joined #crystal-lang
<crystal-gh>
[crystal] PragTob closed pull request #1136: Improve documentation of struct in regards when to use it (gh-pages...when-to-use-struct) http://git.io/v3Icd
<jhass>
meh, could've just rebased
elia has joined #crystal-lang
<BlaXpirit>
git pull --rebase is so ez
<BlaXpirit>
but you cant deny that it's a problematic pull request if it just overwrites the date in so many files
<BlaXpirit>
+ i dont like the tiny change itself
<jhass>
could also have just removed the local commit, forwarded the branch, make a new one and force push that
jhass has left #crystal-lang ["WeeChat 1.2"]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sailorswift has joined #crystal-lang
sailorswift has quit [Client Quit]
sailorswift has joined #crystal-lang
mcgain_ has joined #crystal-lang
mcgain has quit [Ping timeout: 260 seconds]
mcgain_ is now known as mcgain
zamith has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
<dbackeus>
are there any differences in using classes vs modules for namespacing?
<dbackeus>
(assuming not, just want to make sure there are no caveats)
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zamith has quit [Ping timeout: 246 seconds]
zamith has joined #crystal-lang
zamith has quit [Client Quit]
mcgain_ has joined #crystal-lang
mcgain has quit [Ping timeout: 252 seconds]
mcgain_ is now known as mcgain
zamith_ has joined #crystal-lang
mcgain has quit [Client Quit]
kyrylo has joined #crystal-lang
mcgain has joined #crystal-lang
leafybasil has joined #crystal-lang
zamith__ has joined #crystal-lang
zamith_ has quit [Ping timeout: 244 seconds]
zamith___ has joined #crystal-lang
BlaXpirit_ has joined #crystal-lang
elia has quit [Read error: Connection reset by peer]
zamith__ has quit [Ping timeout: 244 seconds]
elia has joined #crystal-lang
naps62 has joined #crystal-lang
BlaXpirit_ has quit [Quit: Konversation]
<BlaXpirit>
dbackeus, i didnt think nested classes were possible
<dbackeus>
yeah, it's been possible in Ruby all along
<dbackeus>
but most people don't know because only modules are ever documented as useful for namespacing
<BlaXpirit>
dbackeus, i think the rule of thumb is use a module unless u also need to instantiate the thing
<dbackeus>
yeah, agreed
<BlaXpirit>
dbackeus, and another thing to note. class String::Builder is valid, which surprised me
<BlaXpirit>
i'm getting expecting token 'EOF', not 'end'
<BlaXpirit>
i checked and rechecked that ends match
<BlaXpirit>
i dont know what to do
<BlaXpirit>
welp
<BlaXpirit>
it was .each |item| do
<BlaXpirit>
i want to talk about utilizing assert and debug_assert in the language.
<BlaXpirit>
this is all doable with macros as demonstrated at link
<BlaXpirit>
but besides all this, such "assert" would be extremely useful during development. it automatically prints out all you need in case of assertion error, no thinking required
<BlaXpirit>
(and like 10 times less typing)
mcgain has quit [Quit: mcgain]
mcgain has joined #crystal-lang
strcmp1 has quit [Quit: Leaving]
<BlaXpirit>
I have `as` fail at compile time. how can I force it to fail at runtime?
<asterite>
I like that idea too, I think Elixir does that too to provide nice error messages without having to write things like "should". But I think because it's a macro, compile times will be slow. I'll try it. If it's not slow maybe it would be good to have that built-in
<BlaXpirit>
asterite, i mean, that one is indeed overkill for typical usage
<BlaXpirit>
but in unittesting performance matters much less
<crystal-gh>
[crystal] asterite closed pull request #1138: Use an up to date ruby version for gh-pages (gh-pages...update-ruby-version) http://git.io/v3IRd
<BlaXpirit>
this is not supposed to work anyway cuz it uses ->(Int)
<BlaXpirit>
but oh my
<jhass>
you've never crashed the compiler yet?
<BlaXpirit>
i dont remember getting a message this big
<BlaXpirit>
[:49:48] <BlaXpirit> I have `as` fail at compile time. how can I force it to fail at runtime? [:52:06] <BlaXpirit> i want code like this to compile https://bpaste.net/show/a70efc40fbc8
<BlaXpirit>
any comments?
<BlaXpirit>
i had to replace this with assert arg.is_a? UInt8 etc
<jhass>
BlaXpirit: tried type restricting arg to the full union?
<BlaXpirit>
jhass, oh it actually was restricted
<BlaXpirit>
and i had to remove the union at one point anyway because the program didnt work with it
<BlaXpirit>
the Type union contained Array(Type)
<BlaXpirit>
and then i had an argument Array(Type), to which i couldn't pass Array(Array(Type))
<BlaXpirit>
actualyl i should try to reproduce and report this
<jhass>
>> alias Type = Int32|Array(Type); a = [] of Type; a << [123, [123]]
<DeBot>
jhass: Error in line 4: no overload matches 'Array(Type)#<<' with types Array((Int32 | Array(Int32))) - http://carc.in/#/r/aqd
<jhass>
mmh
<BlaXpirit>
jhass, you got it
<jhass>
I thought that works
<jhass>
>> alias Type = Int32|Array(Type); a = [] of Type; a << [123, [123]] as Type
<DeBot>
jhass: Error in line 4: can't cast Array((Int32 | Array(Int32))) to Type - http://carc.in/#/r/aqe
<BlaXpirit>
jhass, anyway, the problem with the previously pasted code wasn't that it's not restricted enough. in fact, it was too restricted. the type was known at compile time, so casting `as` anything else gave compiletime error
<asterite>
->test(Int) shouldn't compile, so yes, it's a bug
<BlaXpirit>
but the code that gave compiletime error would not be executed, so if `as` only errored at runtime, that code would work just fine
<nopc0de>
trying to compile the amatista example from their readme
<jhass>
oO, how do you do that...
shama has joined #crystal-lang
dbackeus has quit [Remote host closed the connection]
dbackeus has joined #crystal-lang
havenwood has joined #crystal-lang
dbackeus has quit [Remote host closed the connection]
BlaXpirit has quit [Quit: Konversation]
BlaXpirit has joined #crystal-lang
<crystal-gh>
[crystal] PragTob closed pull request #1132: Remove Iterator#rewind duplication through common module (master...iterator-less-rewind-duplication) http://git.io/v3f1b
dbackeus has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
dbackeus has quit [Ping timeout: 260 seconds]
nopc0de has quit [Ping timeout: 246 seconds]
nopc0de has joined #crystal-lang
kleech has quit [Remote host closed the connection]
nopc0de has quit [Excess Flood]
nopc0de has joined #crystal-lang
naps62 has quit [Remote host closed the connection]
zamith has quit [Quit: Be back later ...]
dbackeus has joined #crystal-lang
mcgain has quit [Quit: mcgain]
<crystal-gh>
[crystal] PragTob opened pull request #1142: Improve documentation of struct in regards when to use it (gh-pages...clarify-struct-vs-class) http://git.io/v3sgD
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 244 seconds]
kyrylo has quit [Ping timeout: 264 seconds]
DeBot has quit [Quit: Crystal IRC]
DeBot has joined #crystal-lang
leafybasil has joined #crystal-lang
DeBot has quit [Client Quit]
DeBot has joined #crystal-lang
elbow has quit [Remote host closed the connection]
nahtnam has joined #crystal-lang
<nahtnam>
Is there a selenium driver for crystal?
<jhass>
I highly doubt so
<nahtnam>
:(
<jhass>
but I mean the thing that's slow there is selenium, doubt it would be faster over using the ruby one
<nahtnam>
Oh ok
<nahtnam>
Im using the ruby one currently
<jhass>
if you're seeking to get something faster, switching to phantomjs is probably more worth the effort
<nahtnam>
Can
<nahtnam>
t
<nahtnam>
Some of the sites we are scraping block it
<jhass>
oO
<jhass>
you tried mechanize too?
<nahtnam>
Yeah :/ Otherwise life would be easy
<jhass>
wth do they do
<nahtnam>
jhass: No, ill ask my coworker
<nahtnam>
We handle giftcard
<nahtnam>
*giftcards
<nahtnam>
and part of it is getting the balance
<nahtnam>
jhass: Do you know how mechanize works? Does it simulate the browser?
<nahtnam>
IE Can the site detect that its a bot?
<nahtnam>
*Should move this to #ruby
<jhass>
that's really not generally answerable
<jhass>
it won't run any JS
<jhass>
beyond that HTTP is HTTP, you can always craft a request that looks identical to coming from a popular browser
<nahtnam>
I doesnt run JS? Some of the sites have ajax forms and what not
<jhass>
so what, these also just end up doing http requests
<crystal-gh>
[crystal] PragTob opened pull request #1149: Fix travis build by using the new names instead of old (master...fix-build-with-build--codegen) http://git.io/v3ZJi
mcgain has joined #crystal-lang
<travis-ci>
manastech/crystal#7f2401e (master - Fixed #1057: wrong error message when invoking new on abstract type and arguments don't match): The build was broken. https://travis-ci.org/manastech/crystal/builds/74985665
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/v3ZkS
<crystal-gh>
crystal/master 4efb5ad Ary Borenszweig: Use `--no-codegen` instead of `--no-build` in travis script. Fixes #1149
nahtnam has quit [Quit: Connection closed for inactivity]
elia has quit [Quit: Computer has gone to sleep.]
Raimondi has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
dbackeus has quit [Remote host closed the connection]
trapped_ has quit [Ping timeout: 252 seconds]
sardaukar has quit [Read error: Connection reset by peer]