Utilities

Haskell-like array slicing

Those who know Haskell probably started learning it by manipulating lists with head and tail. Those functionalities are not available in Julia by default and array slicing - with an ugly syntax - is required. Since this is done often in the fields of application of WallyToolbox, both head and tail together with a body functions are available in its core. They are simple wrapers over the @view macro and work with both iterable types and arrays. The following snippet illustrates their usage.

julia> v = collect(1:4);

julia> head(v) == [1; 2; 3]
true

julia> tail(v) == [2; 3; 4]
true

julia> body(v) == [2; 3]
true

More examples are provided in the documentation of each of the functions.

WallyToolbox.headFunction
head(z)

Access view of array head. See also tail and body.

julia> head(1:4)
1:3

julia> head([1, 2, 3, 4])
3-element view(::Vector{Int64}, 1:3) with eltype Int64:
 1
 2
 3
source
WallyToolbox.tailFunction
tail(z)

Access view of array tail. See also head and body.

julia> tail([1, 2, 3, 4])
3-element view(::Vector{Int64}, 2:4) with eltype Int64:
 2
 3
 4
julia> tail(1:4)
2:4
source
WallyToolbox.bodyFunction
body(z)

Access view of array body. See also head and tail.

julia> body([1, 2, 3, 4])
2-element view(::Vector{Int64}, 2:3) with eltype Int64:
 2
 3
julia> body(1:4)
2:3
source

General utilities

Literate programming

Because WallyToolbox is intended to be run from a portable Julia environment without footprint in the local system, some particularities arise in setting a Jupyter toolset. The following tools tools provide launchers for starting local Jupyter Notebook and Jupyterlab sessions.

Note

Notice it is up to the user to define the path JUPYTER_DATA_DIR as an environment variable; default Jupyter configuration is not accepted because it might break the local system.