Skip to content

Commit

Permalink
Remove old QUASIQUOTE_EXPANDER
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Feb 27, 2024
1 parent c6549d4 commit 58a4ffc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
19 changes: 1 addition & 18 deletions convex-core/src/main/java/convex/core/lang/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<ACell> QUASIQUOTE_EXPANDER =new CoreFn<ACell>(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);
}
};



}
2 changes: 0 additions & 2 deletions convex-core/src/main/java/convex/core/lang/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@ public Context invoke(Context context, ACell[] args) {

public static final AFn<ACell> QUOTE_EXPANDER = reg(Compiler.QUOTE_EXPANDER);

public static final AFn<ACell> QUASIQUOTE_EXPANDER = reg(Compiler.QUASIQUOTE_EXPANDER);

public static final CoreFn<CVMBool> CALLABLE_Q = reg(new CoreFn<>(Symbols.CALLABLE_Q) {

@Override
Expand Down
2 changes: 2 additions & 0 deletions convex-core/src/main/java/convex/core/lang/Symbols.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions convex-core/src/test/java/convex/core/lang/DocsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class DocsTest extends ACVMTest {
@SuppressWarnings("unchecked")
AHashMap<ACell,ACell> doc=(AHashMap<ACell, ACell>) 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);
Expand Down

0 comments on commit 58a4ffc

Please sign in to comment.