| gnufied | chameleon88_, ^^ |
| chameleon88_ | there must be something wrong in the environment... i'm not sure ruby -e "echo 'hello'" |
| baggito | ok thanks |
| chameleon88_ | gives nomethoderror |
| gnufied | chameleon88_, echo is not a method in ruby. |
| chameleon88_ | crap |
| gnufied | chameleon88_, ruby -e "p 'hello world'" |
| chameleon88_ | yeah ok stupid mistake |
| wackimonki | when 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? |
| tpope | each_with_index |
| mithraic | each_with_index |
| wackimonki | ahh |
| mithraic | foo, beaten :) |
| wackimonki | thanks |
| tpope | there isn't a for loop, not as you know it |
| mithraic | actually, i'm pretty sure there is one. but i don't know why anyone would ever use it :) |
| tpope | there is not one as in for(i=0;i<10;i++) there is for object in collection but that's just each in disguise |
| mithraic | ah, you're right. somehow i thought i remembered a 'regular' for loop also. |
| tpope | 17.times do |i| that's the functionality but it doesn't count |
| mithraic | i 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? |
| divoxx | mithraic, you can pass procs objects as arguments, doens't make sense to have more than one block.... how would the syntax look like? |
| mithraic | yeah, 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. |
| rixxon | mithraic: http://pastie.caboo.se/55516 sorta. |
| mithraic | yeah 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? |