summaryrefslogtreecommitdiff
path: root/Source/Dafny/Util.cs
blob: 30258092853dad74b170f570f4906ac4300bd599 (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;
    }
  }
}