sdr 0.5

net.cscott.sdr.calls.lists
Class BasicList

java.lang.Object
  extended by net.cscott.sdr.calls.lists.BasicList

public abstract class BasicList
extends Object

The BasicList class contains complex call and concept definitions which are on the 'basic' program. Note that "simple" calls and concepts are defined in the resource file at net/cscott/sdr/calls/lists/basic.calls; this class contains only those definitions for which an executable component is required.

Version:
$Id: BasicList.java,v 1.20 2009-02-05 06:13:31 cananian Exp $
Author:
C. Scott Ananian

Nested Class Summary
static class BasicList.LRMEvaluator
          Evaluator for left, reverse, and mirror.
static class BasicList.LRMType
          Enumeration: left, reverse, or mirror.
 
Field Summary
static Call _ADD_NUM
          Simple math: addition.
static Call _DIVIDE_NUM
          Simple math: division.
static Call _FRACTIONAL
          The "fractional" concept.
static Call _HALF
           
static Call _MULTIPLY_NUM
          Simple math: multiplication.
static Call _SUBTRACT_NUM
          Simple math: subtraction.
static Call AND
           
static Call LEFT
           
static Call REVERSE
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final Call AND

_ADD_NUM

public static final Call _ADD_NUM
Simple math: addition.

Tests:
js> c=net.cscott.sdr.calls.ast.AstNode.valueOf("(Apply _add_num (Apply 2) (Apply 1))")
(Apply _add_num (Apply 2) (Apply 1))
js> c.expand()
(Seq (Apply 3))

_SUBTRACT_NUM

public static final Call _SUBTRACT_NUM
Simple math: subtraction.

Tests:
js> c=net.cscott.sdr.calls.ast.AstNode.valueOf("(Apply _subtract_num (Apply 3) (Apply 2))")
(Apply _subtract_num (Apply 3) (Apply 2))
js> c.expand()
(Seq (Apply 1))

_MULTIPLY_NUM

public static final Call _MULTIPLY_NUM
Simple math: multiplication.

Tests:
js> c=net.cscott.sdr.calls.ast.AstNode.valueOf("(Apply _multiply_num (Apply 3) (Apply 2))")
(Apply _multiply_num (Apply 3) (Apply 2))
js> c.expand()
(Seq (Apply 6))

_DIVIDE_NUM

public static final Call _DIVIDE_NUM
Simple math: division.

Tests:
js> c=net.cscott.sdr.calls.ast.AstNode.valueOf("(Apply _divide_num (Apply 3) (Apply 2))")
(Apply _divide_num (Apply 3) (Apply 2))
js> c.expand()
(Seq (Apply 1 1/2))

LEFT

public static final Call LEFT

REVERSE

public static final Call REVERSE

_FRACTIONAL

public static final Call _FRACTIONAL
The "fractional" concept.

Tests:
Evaluate TWICE DOSADO and the DOSADO 1 1/2. Note that we prohibit further subdivision of the DOSADO 1 1/2.
js> importPackage(net.cscott.sdr.calls.ast)
js> a1 = Apply.makeApply("dosado")
(Apply dosado)
js> a = Apply.makeApply("_fractional", Apply.makeApply("2"), a1)
(Apply _fractional (Apply 2) (Apply dosado))
js> BasicList._FRACTIONAL.apply(a)
(Seq (Part true (Seq (Apply dosado))) (Part true (Seq (Apply dosado))))
js> a = Apply.makeApply("_fractional", Apply.makeApply("1 1/2"), a1)
(Apply _fractional (Apply 1 1/2) (Apply dosado))
js> BasicList._FRACTIONAL.apply(a)
(Seq (Part false (Seq (Part true (Seq (Apply dosado))) (Part true (In 3 (Opt (From [FACING DANCERS] (Seq (Prim -1, 1, none, 1, SASHAY_START) (Prim 1, 1, none, 1, SASHAY_FINISH)))))))))

_HALF

public static final Call _HALF

sdr 0.5

Copyright © 2006-2009 C. Scott Ananian