<waj>
don't you prefer to use "abstract" and have compile time errors?
<jhass>
I prefer mixins over inheritance but that's another story
<jhass>
and all I'm getting at is that it would be funny construct for code examples. if foo; ...; else do_bar(); end;
<jhass>
;)
<jhass>
abstract is "I never intend to implement this, you should". yada-yada is "I will implement this later/I have no idea what to place here but there should be something there"
<waj>
I see
<jhass>
so any yada-yada could just abort the compiler
<waj>
Yup, it looks funny :)
Rylee has quit [Max SendQ exceeded]
Rylee has joined #crystal-lang
waj has quit [Quit: Leaving.]
whomp has quit [Ping timeout: 258 seconds]
waj has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
dts has quit [Read error: Connection reset by peer]
dts has joined #crystal-lang
dts has quit [Ping timeout: 240 seconds]
travis-ci has joined #crystal-lang
<travis-ci>
manastech/crystal#1667 (master - c07e738 : Juan Wajnerman): The build passed.
<jnoah>
a couple things about strings (and arrays). can strings be treated like character arrays and given arrays, can they be sliced like arrays in python? e.g. my_string[1:] would result in all, but the first character of my_string
<jnoah>
my_string = "bob"; print my_string[1:] # ob
<jnoah>
if not, how would one do something similar?
asterite has joined #crystal-lang
asterite has quit [Remote host closed the connection]
asterite has joined #crystal-lang
asterite1 has joined #crystal-lang
<waj>
a String is represented in memory as UTF-8
<waj>
you can iterate chars in a String using "each_char" for example
<jnoah>
but you cannot index into a string?
<jnoah>
or slice a string?
<waj>
yes
<waj>
just like in Ruby
<waj>
mystring[1..-1]
<jnoah>
ah, alright. thanks :)
* jnoah
is not very familiar with ruby
<jnoah>
just went through the codecademy stuff today. my language of choice is python :/
<waj>
in Ruby (and Crystal) mystring[1..-1] would return "ob" for your example
<waj>
and mystring[1..-2] would return just "o"
asterite has quit [Ping timeout: 244 seconds]
<jnoah>
awesome, thanks! yeah, i just wrote up a test.cr to try it out
<jnoah>
worked like a charm
<waj>
I need to get some sleep. Thank you for joining us! ;)
dts has quit [Read error: Connection reset by peer]
waj has quit [Quit: Leaving.]
asterite1 has quit [Quit: Leaving.]
dts has joined #crystal-lang
<jnoah>
what is all the .crystal/[...]/test.cr/ stuff?
dts has quit [Read error: Connection reset by peer]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
e_dub has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 245 seconds]
<jnoah>
how does one pass arguments to crystal scripts?
<jnoah>
scratch that. also, O_O i just found the browser option for crystal. that is exciting
<jnoah>
ohey, can crystal not read files yet?
<jnoah>
nvm, ruby calls it readlines while crystal calls it read_lines
<jnoah>
I understand why the write fails, but the File.each_line part is failing... http://pastebin.com/xXsP1yDY - what am I doing wrong there?
kostya has quit [Remote host closed the connection]
asterite has joined #crystal-lang
<asterite>
jnoah: wow, one moment you had issues with File.read_lines, the other you sent a message to this channel from a program :-P
<asterite>
The error you got, “undefined constant T (did you mean ‘C’?)”… it’s very confusing, it should say something like “Array is generic”. We’ll improve it
asterite has quit [Client Quit]
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
kostya has joined #crystal-lang
e_dub has joined #crystal-lang
e_dub has quit [Client Quit]
mverzilli has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 264 seconds]
e_dub has joined #crystal-lang
e_dub has quit [Read error: Connection reset by peer]
e_dub has joined #crystal-lang
e_dub has quit [Quit: ZZZzzz…]
bcardiff has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci>
manastech/crystal#1669 (master - 5a99c4d : Ary Borenszweig): The build was broken.