January 2020
Intermediate to advanced
532 pages
13h 31m
English
In Julia, there is a pipe operator that can be used to pass data from one function to another. The concept is very simple. First, let's take a look at some examples.
In the previous section, we developed a fetch_top_stories function that's used to retrieve the current top stories from Hacker News. The return value is a JSON3.Array object that looks like an array of integers. Let's say we want to find the first story ID from the array. To do this, we can create a pipe operation, as follows:

The pipe operator |> is actually defined as a regular function in Julia, just like how + is defined as a function. Note that ...
Read now
Unlock full access