Example #1
0
 public static IImmutableSeq <T> Of <T>(IEnumerable <T> values)
 {
     return(values is IImmutableSeq <T> of
         ? of
         : values is IMutableSeq <T>
            ?((IMutableSeq <T>)values).ToImmutableSeq()
                : MutableSeq.Of(values).ToImmutableSeq());
 }
Example #2
0
        public static IImmutableSeq <char> ToImmutableSeq(string chars)
        {
            var seq = MutableSeq.OfLength <char>(chars.Length);

            for (var i = 0; i < chars.Length; ++i)
            {
                seq[i] = chars[i];
            }

            return(seq.ToImmutableSeq());
        }
Example #3
0
 public static IImmutableSeq <T> Of <T>(params T[] values)
 {
     return(values.Length == 0 ? Empty <T>() : MutableSeq.Of(values).ToImmutableSeq());
 }
Example #4
0
 public static IMutableSeq <T> ToMutableSeq <T>(this IEnumerable <T> source)
 {
     return(MutableSeq.Of(source));
 }