List utility helpers for the Julia port of the OpenModelica compiler.
A Julia translation of the MetaModelica ListUtil module: map, fold,
filter, filterOnTrue, position, flatten, and more
operations on the immutable cons-list type List{T} provided by
MetaModelica.jl and
ImmutableList.jl.
This package is part of the OM.jl suite.
ListUtil.jl is registered in the OpenModelicaRegistry. Add it from a Julia REPL:
import Pkg
Pkg.Registry.add(Pkg.RegistrySpec(url = "https://github.com/OpenModelica/OpenModelicaRegistry.git"))
Pkg.add("ListUtil")using ListUtil
using MetaModelica
lst = list(1, 2, 3, 4)
ListUtil.map(lst, x -> x + 1) # list(2, 3, 4, 5)
ListUtil.fold(lst, (x, acc) -> x + acc, 0) # 10
ListUtil.filterOnTrue(lst, iseven) # list(2, 4)Distributed under the OSMC Public License (OSMC-PL) v1.8 or GNU AGPL v3, at the recipient's choice. See LICENSE.md for the full text.