#ruby-lang - Sat 21 Apr 2007 between 01:46 and 02:19



gnufiedchameleon88_, ^^
chameleon88_there must be something wrong in the environment...
i'm not sure
ruby -e "echo 'hello'"
baggitook thanks
chameleon88_gives nomethoderror
gnufiedchameleon88_, echo is not a method in ruby.
chameleon88_crap
gnufiedchameleon88_, ruby -e "p 'hello world'"
chameleon88_yeah
ok
stupid mistake
wackimonkiwhen i am using: array.each do |element|, is it possible to get an index number from somewhere?
or should i just use(gasp) for loop?
tpopeeach_with_index
mithraiceach_with_index
wackimonkiahh
mithraicfoo, beaten :)
wackimonkithanks
tpopethere isn't a for loop, not as you know it
mithraicactually, i'm pretty sure there is one.
but i don't know why anyone would ever use it :)
tpopethere is not one as in for(i=0;i<10;i++)
there is for object in collection
but that's just each in disguise
mithraicah, you're right. somehow i thought i remembered a 'regular' for loop also.
tpope17.times do |i|
that's the functionality
but it doesn't count
mithraici wish Ruby would hurry up and support multiple blocks as method parameters.
then you could write your own for loop, if you wanted :)
anyone know if that's in the works? Is it planned for 2.0?
divoxxmithraic, you can pass procs objects as arguments, doens't make sense to have more than one block.... how would the syntax look like?
mithraicyeah, but procs are sillily verbose. lambdas too. Should just be able to have multiple { }{ }, or (better) named arguments too -- more Smalltalk-style.
if: { something } else: { somethingElse }
as a method on an object that evaluates to boolean would be nifty.
rixxonmithraic: http://pastie.caboo.se/55516 sorta.
mithraicyeah i agree that's the idea, just would be nice to sugar up the syntax a little more
anyway, my 2 bits for the soapbox :)
any of you running JRuby?

Page: 2 9 16 23 30 37 44 

IrcArchive