Post Made Community Wiki by Dennis
16 added 475 characters in body
source | link

Length 8 Snippet

{3 2 ^-}

This demonstrates another modifier, related to &. Without the ^, the block {3 2 -} would just push the difference of 3 and 2 (1). However, the ^ in front of - makes it do something special. If the block is called with an &, it will execute &- (peek for operands); if not, it will execute - (pop the operands).

Example

>>> {3 2 ^-} =f
:: []

>>> f
:: [1]

>>> &f
:: [1, 3, 2, 1]

Length 8 Snippet

{3 2 ^-}

This demonstrates another modifier, related to &. Without the ^, the block {3 2 -} would just push the difference of 3 and 2 (1). However, the ^ in front of - makes it do something special. If the block is called with an &, it will execute &- (peek for operands); if not, it will execute - (pop the operands).

Example

>>> {3 2 ^-} =f
:: []

>>> f
:: [1]

>>> &f
:: [1, 3, 2, 1]
15 added 8 characters in body
source | link
>>>
:: [1, 2, 3, 4]

>>> [.a, .b] [.b, .a] tran
:: [1, 2, 4, 3]

>>> [1, 2] [2, 1, 2] tran
:: [1, 2, 3, 4, 3]
:: [1, 2, 3, 4]

>>> [.a, .b] [.b, .a] tran
:: [1, 2, 4, 3]

>>> [1, 2] [2, 1, 2] tran
:: [1, 2, 3, 4, 3]
>>>
:: [1, 2, 3, 4]

>>> [.a, .b] [.b, .a] tran
:: [1, 2, 4, 3]

>>> [1, 2] [2, 1, 2] tran
:: [1, 2, 3, 4, 3]
14 deleted 30 characters in body
source | link

If I explain things poorly, or you want to try it yourself, or if you are a filthy doubter, feel free to install the Ruby interpreter

If I explain things poorly, you want to try it yourself, or if you are a filthy doubter, feel free to install the Ruby interpreter

If I explain things poorly or you want to try it yourself, feel free to install the Ruby interpreter

13 added 325 characters in body
source | link
12 added 1 character in body
source | link
11 added 320 characters in body
source | link
10 added 2 characters in body; deleted 11 characters in body
source | link
9 added 116 characters in body
source | link
8 added 361 characters in body
source | link
7 added 181 characters in body
source | link
6 added 267 characters in body
source | link
5 deleted 1 character in body
source | link
4 added 153 characters in body
source | link
3 added 318 characters in body
source | link
2 added 318 characters in body
source | link
1
source | link