File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 464
464
lst = _try_static (static_last (x), static_last (y))
465
465
return Base. Slice (OptionallyStaticUnitRange (fst, lst))
466
466
end
467
+
468
+ function Base. show (io:: IO , r:: OptionallyStaticRange )
469
+ print (io, first (r))
470
+ if known_step (r) === 1
471
+ print (io, " :" )
472
+ else
473
+ print (io, " :" )
474
+ print (io, step (r))
475
+ print (io, " :" )
476
+ end
477
+ print (io, last (r))
478
+ end
Original file line number Diff line number Diff line change 1
1
2
2
"""
3
+ StaticInt(N::Int) -> StaticInt{N}()
4
+
3
5
A statically sized `Int`.
4
6
Use `StaticInt(N)` instead of `Val(N)` when you want it to behave like a number.
5
7
"""
6
8
struct StaticInt{N} <: Integer
7
9
StaticInt {N} () where {N} = new {N::Int} ()
8
10
end
9
11
12
+ Base. show (io:: IO , :: StaticInt{N} ) where {N} = print (io, " Static($N )" )
13
+
10
14
const Zero = StaticInt{0 }
11
15
const One = StaticInt{1 }
12
16
You can’t perform that action at this time.
0 commit comments