Beispiel #1
0
        protected override ISeq <int> NewSeq(int length)
        {
            var impl = Array.OfLength <int>(length);

            for (var i = 0; i < length; ++i)
            {
                impl[i] = i;
            }
            return(new ArraySeqImpl <int>(impl));
        }
Beispiel #2
0
        public IImmutableSeq <TResult> Map <TResult>(Func <T, TResult> mapper)
        {
            var mapped = Array.OfLength <TResult>(Length);

            for (var i = 0; i < Length; ++i)
            {
                mapped[i] = mapper(Values[i]);
            }
            return(new ArrayImmutableSeq <TResult>(mapped.Seal()));
        }
Beispiel #3
0
 protected CharSeqBase(SerializationInfo info, StreamingContext context) : base(Array.OfLength <char>(0))
 {
     Values      = (char[])info.GetValue("_array", typeof(char[]));
     base.Values = Array.Of(CharStore.Of(Values)).Seal();
 }