| genTree printTree pathList tree | genTree := [:paths | | leaf | leaf := paths groupBy: [:path | path first] having: [:g | true]. leaf associationsDo: [:assoc | | newValue | newValue := assoc value collect: [:val | val allButFirst] thenSelect: [:val | val notEmpty]. assoc value: (newValue isEmpty ifTrue: [newValue] ifFalse: [genTree copy fixTemps value: newValue])]]. printTree := [:dic :lev | dic keys asSortedCollection do: [:key | Transcript crtab: lev; show: key. (dic at: key) ifNotEmptyDo: [:child | printTree copy fixTemps value: child value: lev + 1]]]. pathList := #('abc\def' 'abc\def\gh' 'abc\def\ij' 'abc\jk\lm' 'de'). pathList := pathList collect: [:each | each subStrings: {$\}]. World findATranscript: nil. tree := genTree copy fixTemps value: pathList. printTree copy fixTemps value: tree value: 0 "=> abc def gh ij jk lm de "