Skip to content

sabjohnso/Scalar.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scalar

Scalar Type Tools

Build Status codecov.io

Scalar is a Julia package to facilitate the generation of scalar types. Primarily,Scalar defines an abstract type, AbstractScalar, and a number of methods overloaded for that for its subtypes. The list of overloaded methods includes the following: size, eltype, ndims, length, endof, getindex, first, last, start, next, done, isempty, map, filter. These methods are a subset of the methods defined for the abstract type Number, where those methods that imply a numerical nature of the subtypes are excluded. Additionally, the method filter is included here, where it was not specifically defined for Number.

Dual licensing (GPLv3, alternate commercial) - See LICENSE.md

Installation: julia> Pkg.clone( "https://github.com/sabjohnso/Scalar.jl" )

Getting Started

To define a new scalar type:

type MyScalar <: AbstractScalar
end

using Base.Test
a = MyScalar()
@test length( a ) == 1
@test size( a ) == ()
@test map( identity, a ) == a
@test filter( x->isa( x, MyScalar ), a ) == a
@test filter( x->! isa( x, MyScalar ) == nothing

About

Scalar Types

Resources

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE.md
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages