cl-ds / src /cl_macros /synth /template_pool.py
j14i's picture
977 CL macro transformation examples: CL-native pipeline with SBCL verification
d69fc90 verified
"""Instruction template pools for both task formulations."""
MACRO_FROM_USAGE_TEMPLATES = [
"Write a Common Lisp macro to handle this code pattern:\n{before}\n\nProblem: {problem}",
"Generate a defmacro form that transforms code like this:\n{before}\n\nPattern to recognize: {problem}",
"You are a Common Lisp macro expert. Given this code pattern:\n{before}\n\nWrite a macro that addresses: {problem}",
"Define a macro that eliminates this repetitive pattern:\n{before}\n\nIssue: {problem}",
"Given this macro call:\n{before}\n\nAnd its desired expansion:\n{after}\n\nWrite the defmacro definition.",
"The following Lisp code:\n{before}\n\nMacro-expands to:\n{after}\n\nDefine the macro that performs this transformation.",
"Common Lisp programmers often write:\n{before}\n\nInstead, they should be able to write a cleaner form that expands to:\n{after}\n\nDefine the macro.",
"A Common Lisp macro call:\n{before}\n\nShould produce this expansion:\n{after}\n\nImplement the defmacro.",
]
MACRO_FROM_SPEC_TEMPLATES = [
"Given these examples of a Common Lisp macro:\n\n{examples}\n\nAnd this description:\n{description}\n\nWrite the defmacro definition.",
"A macro satisfies these example transformations:\n\n{examples}\n\nThe macro's purpose is: {description}\n\nImplement the defmacro.",
"Study these input/output pairs:\n\n{examples}\n\nDescription: {description}\n\nWrite the Common Lisp macro that implements this behavior.",
]