ua.gradsoft.termware.transformers.list
Class ListInsertTransformer
java.lang.Object
ua.gradsoft.termware.AbstractBuildinTransformer
ua.gradsoft.termware.transformers.list.ListInsertTransformer
- All Implemented Interfaces:
- ITermTransformer
public class ListInsertTransformer
- extends AbstractBuildinTransformer
Insert(e,pos,l) - insert e at pos position in list l.
Insert(e,l) - same as Insert(e,0,l)
More formal definition:
insert($x, 0, $y) [isList($y)] -> [$x:$y]
insert($x, $pos, [$y:$z]) [isInt(pos)] -> [$y:insert($x,$pos-1,$z)]
insert($x, $pos NIL) -> cons($x,NIL)
- Author:
- Ruslan Shevchenko
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final ListInsertTransformer INSTANCE
transform
public Term transform(Term t,
TermSystem system,
TransformationContext ctx)
throws TermWareException
- Description copied from interface:
ITermTransformer
- attempt to transform term
t .
- Parameters:
t - - term to transformsystem - - system which give us access to ebvironment.ctx - - context of transformation.
- Returns:
- - transformed term.
- Throws:
TermWareException
static_transform
public static Term static_transform(Term t,
TermSystem system,
TransformationContext ctx)
throws TermWareException
- Throws:
TermWareException
insert
public static Term insert(Term el,
int pos,
Term list,
TermSystem system)
throws TermWareException
- Throws:
TermWareException
getDescription
public String getDescription()
- Description copied from class:
AbstractBuildinTransformer
- get description of transformer.
Default behaviour -- return the value of annotation @TransformerDescription binded to this.getClass().
- Specified by:
getDescription in interface ITermTransformer- Overrides:
getDescription in class AbstractBuildinTransformer
- See Also:
TransformerDescription
getName
public String getName()
- Description copied from class:
AbstractBuildinTransformer
- get name of transformer.
Default behaviour -- return the value of annotation @TransformerName binded to this.getClass().
- Specified by:
getName in interface ITermTransformer- Overrides:
getName in class AbstractBuildinTransformer
- Returns:
- name of transformer.
- See Also:
TransformerName
internalsAtFirst
public boolean internalsAtFirst()