Skip to content

OpenModelica/ListUtil.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI codecov License: OSMC-PL

ListUtil.jl

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.

Installation

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")

Usage

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)

License

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.

About

Utility function for ListDef in MetaModelica.jl

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages