sS makeSFSynonym(S oldName, S newName) {
  stdFunctions_clearCache();
  S snippetID = stdFunctions_cached().get(oldName);
  if (snippetID == null) {
    snippetID = stdFunctions_cached().get(newName);
    if (snippetID == null)
      fail("Standard function " + oldName + " not found");
    S temp = oldName; oldName = newName; newName = temp;
  }
  if (isStandardFunction(newName))
    ret print("Standard function " + newName + " exists");
    
  L<S> tok = javaTok(loadSnippet(snippetID));
  LL<S> funcs = findFullFunctionDefs(tok, true);
  new L<S> out;
  for (L<S> tokF : funcs) {
    int i = indexOfAny(tokF, 0, "(", "{");
    if (i < 0) continue;
    S fname = get(tokF, i-2);
    if (!eq(fname, oldName)) continue;
    L<S> args = tok_parseArgsDeclList(tokF);
    jreplace(tokF = cloneList(tokF), oldName, newName);
    L<S> start = cloneList(subList(tokF, 0, i));
    jreplace(start, "synchronized", "");
    bool isVoid = containsOneOf(start, "void", "svoid");
    out.add(join(start) + "(" + joinWithComma(trimAll(map tok_dropFinal(args))) + ") {\n"
      + "  " + (isVoid ? "" : "ret ") + oldName + "(" + joinWithComma(lmap tok_nameOfParam(args)) + ");\n"
      + "}");
  }
  if (empty(out))
    fail("No functions found");
  print();
  S src = joinWithEmptyLines(out);
  printIndent(src);
  S newSnippetID = createSnippet(src, newName + " - synonym of " + oldName, snippetType_JavaXInclude());
  checkMarkAnimation_bottomLeft(addStdFunction(newSnippetID, true), 2);
  stdFunctions_clearCache();
  ret "Synonym made!";
}