AF-PlasticUser Guide
Overview
afPlastic
is a library for dynamically generating and compiling Fantom code.
afPlastic
is the cornerstone of afIoc proxied services and Embedded Fantom (efan) templates.
Quick Start
model := PlasticClassModel("MyClass", true) model.addMethod(Str#, "greet", "Str name", """ "Hello \${name}!" """) model.toFantomCode // --> // const class MyClass { // new make(|This|? f := null) { // f?.call(this) // } // // sys::Str greet(Str name) { // "Hello ${name}!" // } // } myType := PlasticCompiler().compileModel(model) myType.make->greet("Mum") // --> Hello Mum!
Release Notes
v1.0.2
- New: Added ctor models.
- New: Updates to ensure backwards compatibility with afIoc.
- Chg: Made
PlasticCompiler.srcCodePadding
mutable so it may be (re)set byafBedSheet
. - Chg: Added
msg()
to SrcCodeErr so Err msgs can be reported. - Bug: The wrong compilation line could be reported in
PlasticErr.toStr()