# Re: type sigils redux, and new unary ^ operator

```HaloO,

Ruud H.G. van Tol wrote:
```
`Yes, it could use a step:`
```
^42.7   = (0, 7, 14, 21, 28, 35)
^42.-7  = (35, 28, 21, 14, 7, 0)
```
```
That is, the modulus is 7 in both cases.

```
```^-42.7  = (-35, -28, -21, -14, -7, 0)
^-42.-7 = (0, -7, -14, -21, -28, -35)
```
```
I would make these

^-42.7  == (-42, -35, -28, -21, -14,  -7)
^-42.-7 == ( -7, -14, -21, -28, -35, -42)

```
```and (^-42.7 + ^42.7) has length 11, maybe better expressed as ^-42.7.42,
```
```
```
And the fact that you concatenate two six-element lists and get one with *11* elements doesn't strike you as odd? I find it very disturbing! E.g.
```when shifting by 42 rightwards I would expect

^-42.7.42 == (-42, -35, -28, -21, -14, -7, 0, 7, 14, 21, 28, 35)

to become

^84.7 == (0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77)

and of course

^84.7 »- 42;

or to more resemble your notation

-42 +« ^84.7;

beeing two other forms to write this kind. Ahh, and should there be
a warning about a remainder for

^45.7 == (0, 7, 14, 21, 28, 35, 42) # rest 3

and how should a negative---err---endpoint be handled? I opt for

^-45.7 == (-49, -35, -28, -21, -14, -7) # rest 4

But the warning could be avoided with some dwimmery after we
observe that 45 == 42 + 3 and -45 == -49 + 4 the respective rests
mean to shift the list rightwards accordingly

^45.7 == (3, 10, 17, 24, 31, 38, 45)        # shift right 3
^-45.7 == (-46, -39, -30, -23, -18, -11, -4) # same

^-45.7 == (-45, -38, -31, -24, -17, -10, -3) # shift right 4
^45.7 == (4, 11, 18, 25, 32, 39, 46)        # same

If you find the above odd, than use the homogenious cases

^45.7  == ( 3,  10,  17,  24,  31,  38,  45)  # shift right  3

and

^-45.-7 == (-3, -10, -17, -24, -31, -38, -45)  # reversed shift right -3
== -« ^45.7

which results in pairwise nullification as expected

^45.7 »+« ^-45.-7 == ^7.0 == (0,0,0,0,0,0,0)

Let's switch to a shorter example list and use the , to build
some subsets of int

^-21.7.0 , ^21.7.0 == (-21, -14, -7, 0,  7, 14)  # length: 42/7 == 6
^-21.7.1 , ^21.7.1 == (-20, -13, -6, 1,  8, 15)
^-21.7.2 , ^21.7.2 == (-19, -12, -5, 2,  9, 16)
^-21.7.3 , ^21.7.3 == (-18, -11, -4, 3, 10, 17)
^-21.7.4 , ^21.7.4 == (-17, -10, -3, 4, 11, 18)
^-21.7.5 , ^21.7.5 == (-16,  -9, -2, 5, 12, 19)
^-21.7.6 , ^21.7.6 == (-15,  -8, -1, 6, 13, 20)
^-21.7.7 , ^21.7.7 == (-14,  -7,  0, 7, 14, 21)

If the lists where extended on both sides to infinity then a
shift of 7 changes anything, as can be seen from the last line.

Hmm, the syntax is ambigous with respect to the . if we want to
allow steps < 1. Looks like a jobs for the colon:

^21:7:0 == (0, 7, 14)

^1:0.25 == (0, 0.25, 0.5, 0.75)

^1:0.2:0.2 == (0.2, 0.4, 0.6, 0.8, 1.0)

which perhaps just mean

^1:step(0.2):shift(0.2)

Please note that all of the above are *list literals* not
prefix ^ operator invocations. If one wants to become variable
in this type/kind then a @var is needed. A ^\$x might be just
a short form of capturing the kind of \$x into ^x which not
auto-listifies. Thus

my ^x \$x = 7;

say ^x;   # Int
say +\$x;  # 7

but

my ^a @a = (0,0,0);

say [EMAIL PROTECTED];  # 3
say ^a;   # Array is shape(3) of Int
# Array[^3] of Int
# Array[ shape => 3, kind => Int ]

or however the structure of an array is printed.

```
```which makes '^5' the short way to write '^5.1.0'.
```
```
And ^0 is *the* empty list. Hmm, and ^Inf.0 the infinite
list full of zeros (0, 0, 0, ...), ^Inf.1 are of course
the non-negative integers in a list (0, 1, 2, ...). Then
if we hyperate it and pick the last entry (^Inf.1 »+ 1)[-1]
we get the first transfinite ordinal Omega[0]. From there we
keep counting transfinitely...

And of course 10 * ^0.pi == 3.14...
--
\$TSa.greeting := "HaloO"; # mind the echo!

```
• Re: type sigils redux, and new unary ^ operator TSa