Package kawa.lang

Class Quote

  • All Implemented Interfaces:
    gnu.kawa.format.Printable, Named
    Direct Known Subclasses:
    syntax

    public class Quote
    extends Syntax
    The Syntax transformer that re-writes the "quote" "quasiquote" primitive. In both cases recursively resolves SyntaxForm wrappers and resolves namespaces of symbols. In the case of quasiquote also handles unquoting.
    • Field Detail

      • plainQuote

        public static final Quote plainQuote
      • quasiQuote

        public static final Quote quasiQuote
      • QUOTE_DEPTH

        protected static final int QUOTE_DEPTH
        An initial value for 'depth' for plain (non-quasi) quote.
        See Also:
        Constant Field Values
      • isQuasi

        protected boolean isQuasi
        True for quasiquote; false for plain quote.
    • Constructor Detail

      • Quote

        public Quote​(java.lang.String name,
                     boolean isQuasi)
    • Method Detail

      • matchesQuasiQuote

        protected boolean matchesQuasiQuote​(java.lang.Object form,
                                            SyntaxForm syntax,
                                            Translator tr)
      • expand

        protected java.lang.Object expand​(java.lang.Object template,
                                          int depth,
                                          Translator tr)
      • quote

        public static java.lang.Object quote​(java.lang.Object obj,
                                             Translator tr)
        Quote an object (without namespace-expansion). Basically just recursively removes SyntaxForm wrappers.
      • quote

        public static java.lang.Object quote​(java.lang.Object obj)
        Quote an object (without namespace-expansion). Basically just recursively removes SyntaxForm wrappers.
      • coerceExpression

        protected Expression coerceExpression​(java.lang.Object val,
                                              Translator tr)
      • expandColonForms

        protected boolean expandColonForms()
      • makeSymbol

        public static Symbol makeSymbol​(Namespace ns,
                                        java.lang.Object local)
      • rewrite

        public Expression rewrite​(java.lang.Object obj,
                                  Translator tr)
        Description copied from class: Syntax
        Re-write an expression that is an "application" of this Syntax object.
        Overrides:
        rewrite in class Syntax
        Parameters:
        obj - the arguments to this "application" (i.e. the cdr of the macro/builtin invocation)
        tr - the Translator that provides context
        Returns:
        the re-written expression
      • consX$V

        public static java.lang.Object consX$V​(java.lang.Object[] args)
        A wrapper around LList.consX to make it a "variable-arg method".
      • append$V

        public static java.lang.Object append$V​(java.lang.Object[] args)
        Same as regular append, but handle SyntaxForm wrappers.