sdr 0.7

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 _CIRCLE_ADJUST
          Adjust circle to its other orientation.
static Call _FRACTIONAL
          The "fractional" concept.
static Call _HALF
          Grammar tweak: allow "do half of a ..." in addition to the longer-winded "do one half of a..." or "do a half of a...".
static Call _SCRAMBLE_HOME
          Used for 'scramble home' call.
static Call _WITH_DESIGNATED
          The "with designated" concept saves the designated dancers (in the DanceState) so that they can be referred to later in the call.
static Call AND
          Simple combining concept.
static Call IN
          Time readjustment.
static Call LEFT
           
static Call QUASI_CONCENTRIC
          Like the "concentric" concept, but no adjustment for ends.
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
Simple combining concept.


IN

public static final Call IN
Time readjustment.


LEFT

public static final Call LEFT

REVERSE

public static final Call REVERSE

_WITH_DESIGNATED

public static final Call _WITH_DESIGNATED
The "with designated" concept saves the designated dancers (in the DanceState) so that they can be referred to later in the call. This is used for '<anyone> hop' and even for the humble '<anyone> run'. Takes at least two arguments; all except the last are tag names; dancers who match any of these tags are saved as the 'designated' ones. (Note that you can add 'DESIGNATED' as one of the tags in order to grow the designated tag set after performing another match; not sure if that would ever be necessary.)

Tests:
Show how this concept is used for 'designees run':
js> importPackage(net.cscott.sdr.calls.ast)
js> a1 = Expr.literal("_designees run")
'_designees run
js> a = new Apply(new Expr("_with designated", Expr.literal("boy"), a1))
(Apply (Expr _with designated 'boy '_designees run))

QUASI_CONCENTRIC

public static final Call QUASI_CONCENTRIC
Like the "concentric" concept, but no adjustment for ends. What's usually meant by "centers X while the ends do Y".


_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)
js> importPackage(net.cscott.sdr.calls.ast)
js> ds = new DanceState(new DanceProgram(Program.C4), Formation.SQUARED_SET); undefined;
js> a1 = Expr.literal("dosado")
'dosado
js> a = new Expr("_fractional", Expr.literal("2"), a1)
(Expr _fractional '2 'dosado)
js> BasicList._FRACTIONAL.getEvaluator(ds, a.args).simpleExpansion()
(Seq (Apply 'dosado) (Apply 'dosado))
js> a = new Expr("_fractional", Expr.literal("1 1/2"), a1)
(Expr _fractional '1 1/2 'dosado)
js> BasicList._FRACTIONAL.getEvaluator(ds, a.args).simpleExpansion()
(Seq (Part 'INDETERMINATE '1 (Seq (Apply 'dosado) (Part 'DIVISIBLE '1 (In (Expr _multiply num '1/2 '6) (Opt (From 'ANY (Seq (Part 'INDIVISIBLE '1 (Seq (Apply '_mixed touch))) (Part 'DIVISIBLE '3 (In (Expr _multiply num '1/3 '6) (Opt (From 'RH MINIWAVE (Seq (Prim 1, 1, none, 1, SASHAY_FINISH))))))))))))))

_HALF

public static final Call _HALF
Grammar tweak: allow "do half of a ..." in addition to the longer-winded "do one half of a..." or "do a half of a...".


_CIRCLE_ADJUST

public static final Call _CIRCLE_ADJUST
Adjust circle to its other orientation. Used for 'circle choreography' like allemande left, swing thru from an alamo ring, etc.

Tests:
Basic application from a squared set/circle.
js> importPackage(net.cscott.sdr.calls);
js> importPackage(net.cscott.sdr.calls.ast);
js> ds = new DanceState(new DanceProgram(Program.BASIC), Formation.SQUARED_SET); undefined;
js> ds.currentFormation().toStringDiagram("|");
|     3Gv  3Bv
|
|4B>            2G<
|
|4G>            2B<
|
|     1B^  1G^
js> comp = AstNode.valueOf("(Seq (Apply '_circle adjust))");
(Seq (Apply '_circle adjust))
js> new Evaluator.Standard(comp).evaluateAll(ds);
js> Breather.breathe(ds.currentFormation()).toStringDiagram("|");
|     3GQ       3BL
|
|4BQ                 2GL
|
|
|
|4G7                 2B`
|
|     1B7       1G`
js> new Evaluator.Standard(comp).evaluateAll(ds);
js> Breather.breathe(ds.currentFormation()).toStringDiagram("|");
|     3Gv  3Bv
|
|4B>            2G<
|
|4G>            2B<
|
|     1B^  1G^
Works from non-squared O spots as well
js> importPackage(net.cscott.sdr.calls);
js> importPackage(net.cscott.sdr.calls.ast);
js> ds = new DanceState(new DanceProgram(Program.BASIC), Formation.SQUARED_SET); undefined;
js> comp = AstNode.valueOf("(Seq (Apply 'face out) (Apply '_circle adjust))");
(Seq (Apply 'face out) (Apply '_circle adjust))
js> new Evaluator.Standard(comp).evaluateAll(ds);
js> Breather.breathe(ds.currentFormation()).toStringDiagram("|");
|     3GL       3BQ
|
|4B7                 2G`
|
|
|
|4GQ                 2BL
|
|     1B`       1G7

_SCRAMBLE_HOME

public static final Call _SCRAMBLE_HOME
Used for 'scramble home' call.


sdr 0.7

Copyright © 2006-2009 C. Scott Ananian