From acb98ae145f0a5ddecc56d64fc1f6f6428f9707f Mon Sep 17 00:00:00 2001 From: developtheweb Date: Thu, 9 Jul 2026 02:54:10 -0400 Subject: [PATCH] Fix examples so all ten parse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 03: handler clause uses the canonical arrow (↯e ⟹ …, was ↯e ⇒ …) - 05: give sin/cos a real placeholder body (⊥) — a comment-only body is empty and cannot parse - Run parseExamples on the test runtime classpath; ParseExamples lives in the test source set and was never found on main.runtimeClasspath ./gradlew parseExamples now reports 10/10 PASS --- build.gradle | 6 ++++-- examples/03_file_processing.mpl | 2 +- examples/05_module_definition.mpl | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 7885431..bb19da8 100644 --- a/build.gradle +++ b/build.gradle @@ -47,8 +47,10 @@ test { } } -task parseExamples(type: JavaExec, dependsOn: classes) { +// ParseExamples lives in the test source set, so the task needs the test +// runtime classpath (with main.runtimeClasspath the class was never found). +task parseExamples(type: JavaExec, dependsOn: testClasses) { mainClass = 'com.mpl.test.ParseExamples' - classpath = sourceSets.main.runtimeClasspath + classpath = sourceSets.test.runtimeClasspath args = ['examples'] } \ No newline at end of file diff --git a/examples/03_file_processing.mpl b/examples/03_file_processing.mpl index 87fdb4b..890c0c9 100644 --- a/examples/03_file_processing.mpl +++ b/examples/03_file_processing.mpl @@ -4,4 +4,4 @@ processFile ≜ λpath: { result ← transform(data); writeFile(result, 🖫"output.txt"); ⟨"success"|"failed"⟩ -} ↴ {↯e ⇒ ⟨⊥|e⟩}; \ No newline at end of file +} ↴ {↯e ⟹ ⟨⊥|e⟩}; \ No newline at end of file diff --git a/examples/05_module_definition.mpl b/examples/05_module_definition.mpl index 8d1063d..d0e2762 100644 --- a/examples/05_module_definition.mpl +++ b/examples/05_module_definition.mpl @@ -1,8 +1,8 @@ -- Module definition example 𝓜 Mathematics ⇒ { π ≜ 3.14159; - sin ≜ λx∈ℝ: {- implementation -}; - cos ≜ λx∈ℝ: {- implementation -} + sin ≜ λx∈ℝ: ⊥ {- implementation deferred until MPL executes -}; + cos ≜ λx∈ℝ: ⊥ {- implementation deferred until MPL executes -} }; angle ← π/4;