Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simpler way to do repeated `back back series`

Tags:

series

rebol

red

Sometimes, I tend to do next next a (repeatedly) to get at a particular element. This works well when you need 2 or less traversals. However, it gets cumbersome pretty soon. A loop is too much overhead for this simple case.

Fortunately you can do at series pos in some cases if you know the position.

When it comes to removing the redundancy for the reverse function, a.k.a back, this doesn't work as well tho.

Preferably, I want to do something like at, but relative to the current position in the series

like image 278
Geeky I Avatar asked Jul 14 '17 03:07

Geeky I


People also ask

What is the one stretch that relieves back pain?

Two effective stretches for the back muscles are back flexion and knee-to-chest. For the hip and gluteus stretches, these are piriformis stretch and hip flexor stretch. One of the most important muscles to stretch is the hamstring.


1 Answers

skip allows you to move forwards or backwards from the current position in the series.

>> series: [ 1 2 3 4 5 6]
== [1 2 3 4 5 6]

>> series: skip series 2
== [3 4 5 6]

>> series: skip series 3
== [6]

>> series: skip series -3
== [3 4 5 6]
like image 71
Graham Chiu Avatar answered Sep 17 '22 22:09

Graham Chiu