Skip to content

SciML/MaybeInplace.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaybeInplace

Join the chat at https://julialang.zulipchat.com #sciml-bridged

CI codecov Package Downloads Aqua QA

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

MaybeInplace.jl does a simple thing: If you write a code for mutable arrays, that won't work for immutable arrays. This package provides a macro @bb or @bangbang that will automatically convert the code to make it work for immutable arrays as well.

Installation

MaybeInplace is a   Julia Language   package. To install MaybeInplace, please open Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following command

pkg> add MaybeInplace

How This Works?

The code is simple enough to be self-explanatory. The basic idea is as follows, if you have the following code:

@bb @. x = y + z

This macro will convert it to:

if setindex_trait(x) === CanSetindex()
    @. x = y + z
else
    x = @. y + z
end

About

Rewrite Inplace Operations to be OOP if needed

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages