<commit_before>
public func escapeString(s: String) -> String {
  var z = ""
  debugPrint(s, terminator: "", toStream: &z)
  return z
}

public func inspect(o: Any) -> String {
  var z = ""
  debugPrint(o, terminator: "", toStream: &z)
  return z
}

public func p(a: Any...) {
  for e in a {
    debugPrint(e)
  }
}<commit_msg>Added support for printList. It's a command like "puts" in Ruby.<commit_after>
public func escapeString(s: String) -> String {
  var z = ""
  debugPrint(s, terminator: "", toStream: &z)
  return z
}

public func inspect(o: Any) -> String {
  var z = ""
  debugPrint(o, terminator: "", toStream: &z)
  return z
}

public func p(a: Any...) {
  for e in a {
    debugPrint(e)
  }
}

// printList is like the "puts" command in Ruby.
// printList will check whether the line ends with a new line, and if it does
// not, it will append a new line to it.
// It will also print the individual items of arrays and variadic parameters on
// separate lines.
// Since importing Glibc already imports the "puts" command found in C which
// would conflict with this command, we've given it a unique name instead.
func printList(string: String) {
  // 10 - new line
  if string.isEmpty ||  string.utf8[
      string.utf8.startIndex.advancedBy(string.utf8.count - 1)] != 10 {
    print(string)
  } else {
    Stdout.write(string)
  }
}

func printList(strings: [String]) {
  for s in strings {
    printList(s)
  }
}

func printList(bunch: [Any]) {
  p("check")
  for o in bunch {
    printList("\(o)")
  }
}

func printList(list: Any...) {
  for v in list {
    printList("\(v)")
  }
}
{'fraction_non_alphanumeric': 0.13650594865372573, 'fraction_numerical': 0.005009392611145898, 'mean_word_length': 3.0150753768844223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4694382', 'n_tokens_mistral': 560, 'n_tokens_neox': 547, 'n_words': 193}