From 58a4ffce4a57dcb47e64702f6f2b178be6d96f73 Mon Sep 17 00:00:00 2001 From: mikera Date: Tue, 27 Feb 2024 10:34:33 +0000 Subject: [PATCH] Remove old QUASIQUOTE_EXPANDER --- .../main/java/convex/core/lang/Compiler.java | 19 +------------------ .../src/main/java/convex/core/lang/Core.java | 2 -- .../main/java/convex/core/lang/Symbols.java | 2 ++ .../test/java/convex/core/lang/DocsTest.java | 1 + 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/convex-core/src/main/java/convex/core/lang/Compiler.java b/convex-core/src/main/java/convex/core/lang/Compiler.java index 3bda3efa3..bf2e0caee 100644 --- a/convex-core/src/main/java/convex/core/lang/Compiler.java +++ b/convex-core/src/main/java/convex/core/lang/Compiler.java @@ -800,23 +800,6 @@ public Context invoke(Context context,ACell[] args ) { return context.withResult(Juice.EXPAND_CONSTANT,x); } }; - - /** - * Expander used for expansion of `quasiquote` forms. - * - * Should work on both raw forms and syntax objects. - * - * Follows the "Expansion-Passing Style" approach of Dybvig, Friedman, and Haynes - */ - public static final AFn QUASIQUOTE_EXPANDER =new CoreFn(Symbols.QUASIQUOTE) { - @Override - public Context invoke(Context context,ACell[] args ) { - if (args.length!=2) return context.withArityError(exactArityMessage(2, args.length)); - ACell x = args[0]; - - return context.withResult(Juice.EXPAND_CONSTANT,x); - } - }; - + } diff --git a/convex-core/src/main/java/convex/core/lang/Core.java b/convex-core/src/main/java/convex/core/lang/Core.java index 765d67047..3150020d0 100644 --- a/convex-core/src/main/java/convex/core/lang/Core.java +++ b/convex-core/src/main/java/convex/core/lang/Core.java @@ -637,8 +637,6 @@ public Context invoke(Context context, ACell[] args) { public static final AFn QUOTE_EXPANDER = reg(Compiler.QUOTE_EXPANDER); - public static final AFn QUASIQUOTE_EXPANDER = reg(Compiler.QUASIQUOTE_EXPANDER); - public static final CoreFn CALLABLE_Q = reg(new CoreFn<>(Symbols.CALLABLE_Q) { @Override diff --git a/convex-core/src/main/java/convex/core/lang/Symbols.java b/convex-core/src/main/java/convex/core/lang/Symbols.java index cdf7acdf8..8d53a40ee 100644 --- a/convex-core/src/main/java/convex/core/lang/Symbols.java +++ b/convex-core/src/main/java/convex/core/lang/Symbols.java @@ -329,6 +329,8 @@ public class Symbols { public static final Symbol MEMORY_VALUE = intern("memory-value"); public static final Symbol PROTOCOL = intern("protocol"); + public static final Symbol PRIVATE_Q = intern("private?"); + public static Symbol intern(String s) { AString name=Strings.create(s); Symbol sym=Symbol.create(name); diff --git a/convex-core/src/test/java/convex/core/lang/DocsTest.java b/convex-core/src/test/java/convex/core/lang/DocsTest.java index cded39569..42905ef43 100644 --- a/convex-core/src/test/java/convex/core/lang/DocsTest.java +++ b/convex-core/src/test/java/convex/core/lang/DocsTest.java @@ -25,6 +25,7 @@ public class DocsTest extends ACVMTest { @SuppressWarnings("unchecked") AHashMap doc=(AHashMap) meta.get(Keywords.DOC); if (doc==null) { + if (RT.bool(meta.get(Symbols.PRIVATE_Q))) continue; if (PRINT_MISSING) System.err.println("No documentation in Core: "+sym); } else { doDocTest(sym,doc);