summaryrefslogtreecommitdiff
path: root/Source/Dafny/Util.cs
blob: 8db3ebc8753c59fd6968a73eded989e670a400cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Dafny {
  class Util
  {
     public delegate string ToString<T>(T t);
     public static string Comma<T>(string comma, IEnumerable<T> l, ToString<T> f) {
       string res = "";
       string c = "";
       foreach(var t in l) {
         res += c + f(t);
         c = comma;
       }
       return res;
     }
  }
}