From 5a02170f9e1952cd335b6b097e8ce33de7bb35b1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 12 Nov 2022 11:13:53 +0100 Subject: Introduce new type for attribute names There's a serious problem with the design so far, where symbols are used for attribute names (intensity, strobe, colour etc), and also for attribute values (on, off, random etc). There's no way for 'at' to tell the difference between the two. For example, this form is ambiguous: (at myfixture 'strobe 'on) This commit introduces a new class, , to replace the use of symbols here. The attributes are enumerated in (starlet attributes), and new ones can be added later. The attribute objects remember their 'canonical' names, to allow states to be printed. Apart from solving the ambiguity problem, this has two further advantages. First, attribute names no longer need to be quoted everywhere. Second, multiple names can be used to refer to the same attribute. For example: (define color colour). --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8761b35..8c28054 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Lighting fixtures are referred to by names, rather than numbers: ;; Turn on both moving lights and set colour (at moverL moverR 60) -(at moverL moverR 'colour (rgb 45 10 0)) +(at moverL moverR colour (rgb 45 10 0)) ``` The fixture names are normal Scheme variables. You can do usual things such @@ -70,9 +70,9 @@ with a variable name: (at footlights 100) (at front-wash 100) (at moverL moverR 100) - (at moverL moverR 'tilt 45) - (at moverL 'pan -15) - (at moverR 'pan 15))) + (at moverL moverR tilt 45) + (at moverL pan -15) + (at moverR pan 15))) ``` A cue is formed by associating a lighting state with a *transition effect*, @@ -98,7 +98,7 @@ of cues: ;; Act 1, Scene 1 (lighting-state (at front-wash 80) - (at moverL 'colour (cmy 25 0 0))) + (at moverL colour (cmy 25 0 0))) (at moverL 25) (crossfade 3)) -- cgit v1.2.3