Welcome to mirror list, hosted at ThFree Co, Russian Federation.

let_binding.pcl « let_binding « examples - github.com/ianj-als/pcl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7e68e74c3ba25d25f1775b99ea2552b00bc52123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pcl.os.path as path
import pcl.util.list as list
import pcl.util.string as string

component let_binding
  input filename
  output filename.new
  configuration working.directory
  do
    # Create the pathname of the re-encoded corpus
    result <- let
                basename <- path.basename(filename)
                pieces <- path.splitext(basename)
                base <- list.index(pieces, 0)
                ext <- list.index(pieces, 1)
                bits <- list.cons(base, "new", ext)
                new_basename <- string.join(bits, ".")
              in
                path.join(@working.directory, new_basename)

    return filename.new <- result