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

github.com/ianj-als/pcl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/let_binding/let_binding.pcl')
-rw-r--r--examples/let_binding/let_binding.pcl21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/let_binding/let_binding.pcl b/examples/let_binding/let_binding.pcl
new file mode 100644
index 0000000..7e68e74
--- /dev/null
+++ b/examples/let_binding/let_binding.pcl
@@ -0,0 +1,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