<johnjaye>
is there another way to do a loop in reverse other than downto
<johnjaye>
as in 10.downto(5).each { ...
joast has quit [Quit: Leaving.]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
some14u has joined #ruby
keypresser86 has quit []
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
shokohsc51085 has joined #ruby
totoro has joined #ruby
shokohsc5108 has quit [Ping timeout: 256 seconds]
shokohsc51085 is now known as shokohsc5108
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
_ht has quit [Quit: _ht]
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
_ht has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
Argorok has joined #ruby
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
llua has joined #ruby
<ox1eef_>
No need for each in that example. 10.downto(5) { ... } is enough. I don't know of many other ways, besides a loop and a counter. Ranges are expected to ascend rather than descend. Eg: (10..5).to_a is probably not what you'd expect.
desnudopenguino1 has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
desnudopenguino has quit [Ping timeout: 248 seconds]
desnudopenguino1 is now known as desnudopenguino
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
totoro has joined #ruby
totoro has quit [Remote host closed the connection]
MarvelousWololo has quit [Read error: Connection reset by peer]
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
bhaak has quit [Ping timeout: 246 seconds]
patrick- has quit [Ping timeout: 252 seconds]
patrick- has joined #ruby
reset has joined #ruby
konsolebox has quit [Ping timeout: 246 seconds]
infinityfye has joined #ruby
tuxcrafter has quit [Quit: Client closed]
bhaak has joined #ruby
desnudopenguino has quit [Read error: Connection reset by peer]
dza has quit [Quit: ]
dza has joined #ruby
shokohsc51083 has joined #ruby
shokohsc5108 has quit [Ping timeout: 252 seconds]
shokohsc51083 is now known as shokohsc5108
sagax has quit [Quit: Konversation terminated!]
dalan03822 has quit [Quit: dalan03822]
dalan03822 has joined #ruby
user23 has joined #ruby
user23 has quit [Remote host closed the connection]
Sankalp has quit [Ping timeout: 246 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
_whitelogger has joined #ruby
Sankalp has joined #ruby
desnudopenguino has joined #ruby
some14u has joined #ruby
Argorok has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
<adam12>
Good morning
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
eddof13 has joined #ruby
brokkoli_origin has quit [Ping timeout: 250 seconds]
brokkoli_orig has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Client Quit]
c10l6 has quit [Ping timeout: 246 seconds]
<johnjaye>
can you use ruby in visual studio or vscode
<johnjaye>
is "reverse_each" a common thing or only for ranges
MarvelousWololo has joined #ruby
some14u has joined #ruby
eddof13 has quit [Ping timeout: 246 seconds]
<ox1eef_>
You can find where a method comes from with Method#owner: [].method(:reverse_each).owner, (1..5).method(:reverse_each).owner, etc.
<ox1eef_>
Good morning adam12
<adam12>
johnjaye: What do you mean 'use'? Can you 'edit'?
<adam12>
ox1eef_: how goes
rvalue has quit [Ping timeout: 248 seconds]
<ox1eef_>
All good in the hood, and you?
<adam12>
ox1eef_: Not too bad.
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neshpion has joined #ruby
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_ht has joined #ruby
willfish has quit [Ping timeout: 245 seconds]
TomyWork has quit [Remote host closed the connection]
<havenwood>
johnjaye: Since there's an Enumerable#reverse_each it's quite common. Anything that includes Enumerable supports #reverse_each either through an optimized implementations or Enumerable's default one.
<havenwood>
implementation*
<johnjaye>
adam12: well. like you'd do with python or perl
<johnjaye>
idk if you can use debugger in those languages
<johnjaye>
Enumerable is a "mixin", not an actual class? so similar to an interface in java?
grenierm has joined #ruby
<weaksauc_>
enumerable is a module
<weaksauc_>
which is not a class yes
<weaksauc_>
but it is a collection of methods that you can include into your derivative classes so long as you implement each (and maybe one other method i'm forgetting)
<havenwood>
johnjaye: Enumerable is a Module but not a Class. Module is a Class. You can ask them.
<havenwood>
leftylink: Yeah, more straightforward to just ask it its #class.
<havenwood>
johnjaye: You can't be a Module and a Class, just one or the other. Classes can inherit from one class and mixin many Modules.
<weaksauc_>
you can also have modules that have methods directly on them
grenierm has quit [Quit: Client closed]
caedmon has joined #ruby
willfish has joined #ruby
otisolsen70 has joined #ruby
infinityfye has quit [Ping timeout: 248 seconds]
otisolsen70 has quit [Quit: Leaving]
_ht has quit [Quit: _ht]
<ox1eef_>
Those details can be a bit confusing and I'd probably skip them until I'm interested in meta programming. Classes, modules, and mixins are vanilla yoghurt, and a great start to write easy to understand and maintainable Ruby applications.
some14u has joined #ruby
caedmon has quit [Ping timeout: 256 seconds]
willfish has quit [Quit: WeeChat 4.0.2]
willfish has joined #ruby
<johnjaye>
oh ok
FetidToot1 has joined #ruby
FetidToot has quit [Ping timeout: 250 seconds]
FetidToot1 is now known as FetidToot
NightMonkey has quit [Ping timeout: 260 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]