Welcome to my Code Snippets

MyCodeSnippets.Space

Creating an operator in Redlang: pipe example

ReAdABLE Source (What is the ReAdABLE Human Format?)

http://mycodesnippets.space/redlang/operator.red

How to create the pipe operator:



pipe: function [x 'y] [
    value: get y value x
] 

|: make op! :pipe
        

Examples:


["A" "B" "C"] | 'rejoin ; "ABC"
"ABC" | 'lowercase ; "abc"

["A" "B" "C"] | 'rejoin | 'lowercase ; "abc"           
        

References