// retoor <retoor@molodetz.nl>
import "pathlib" for Path
var p1 = Path.new("/home/user/file.txt")
var p2 = p1.withName("other.md")
System.print(p2) // expect: /home/user/other.md
var p3 = p1.withStem("archive")
System.print(p3) // expect: /home/user/archive.txt
var p4 = p1.withSuffix(".bak")
System.print(p4) // expect: /home/user/file.bak
var p5 = Path.new("/data/file.tar.gz").withSuffix(".zip")
System.print(p5) // expect: /data/file.tar.zip