: join-with-dash ( Variant -- String )
    "" [
        swap dup string.empty? [
            drop                              # first element: just keep it
        ] [
            "-" string.concat swap string.concat  # append "-elem" to acc
        ] if
    ] list.fold
;

: test-fold ( -- )
    "one two three" " " string.split join-with-dash
    "one-two-three" string.equal? test.assert
;
