Skip to content

A small package for defining absent (i.e., null) types and behaviors

License

Notifications You must be signed in to change notification settings

CliMA/NullBroadcasts.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NullBroadcasts.jl

Docs Build docs build
Documentation dev
GHA CI gha ci
Code Coverage codecov

This package defines NullBroadcasted(), which can be added to, subtracted from, or multiplied by any value in a broadcast expression without incurring a runtime performance penalty.

Example

using NullBroadcasts: NullBroadcasted
using Test

x = [1]; y = [1]
a = NullBroadcasted()
@. x = x + a + y
@test x[1] == 2 # passes

x = [1]; y = [1]
@. x = x - a + y
@test x[1] == 2 # passes

@. x = x + (x * a) # equivalent to @. x = x

@. x = x * a # not allowed, errors
@. x = a # not allowed, errors

About

A small package for defining absent (i.e., null) types and behaviors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages