Demonstration - Oblique Strategies
"The Oblique Strategies are a deck of cards. Up until 1996, they were quite easy to describe. They measured about 2-3/4" x 3-3/4". They came in a small black box which said "OBLIQUE STRATEGIES" on one of the top's long sides and "BRIAN ENO/PETER SCHMIDT" on the other side. The cards were solid black on one side, and had the aphorisms printed in a 10-point sans serif face on the other.Oblique StrategiesA web-based installation of Oblique Strategies is supplied in the standard Protium install. Using the "Internet Information Services" snap-in, create a virtual directory pointing to C:\protium\Code\prx\os. Specify its default as index.prx, call it 'os', and share the C:\protium\Code\prx\os directory (Microsoft Access is picky about being able to write to databases even when only reading.)
The deck itself had its origins in the discovery by Brian Eno that both he and his friend Peter Schmidt ... tended to keep a set of basic working principles which guided them through the kinds of moments of pressure — either working through a heavy painting session or watching the clock tick while you're running up a big buck studio bill. Both Schmidt and Eno realized that the pressures of time tended to steer them away from the ways of thinking they found most productive when the pressure was off. The Strategies were, then, a way to remind themselves of those habits of thinking — to jog the mind."
Further information on setting up IIS can be found in the Protium document "C:\protium\bin\plugins\Configuring Windows IIS 5 to use with Protium and Isis.html"
The Protium code in the index.prx file is as follows: The above code (indented only to more clearly demonstrate document structure) outputs a different strategy each time the page is refreshed. The syllables translate as follows:
|<@ DEFKEYLIT>__Transput|__HTMLTransput</@>||define the Transput as HTML|
|<@ SAYPRO>@>||output a document prologue. (What is output by the PRO syllable depends on the Transput defined, as is the case for all document related syllables.)|
|<@ SAYDOC>@>||Enclose a document.|
|<@ SAYDHD>@>||Enclose a document header, in the context of an existing document.|
|<@ SAYDTT>Oblique strategies</@>||set the document title, in the context of an existing document body and header.|
|<@ SAYDBD></@>||enclose a document body, in the context of an existing document.|
|<@ DEFDBFLIT>os</@>||opens this data source, by default a JET/MSAccess database.|
|<@ DEFRSTCAP>select * from os where cardid = <@ SAYRANLIT>100</@></@>||Open record source defined by captured output.|
|<@ SAYRANLIT>100</@>||return a random number between 1 and 100.|
|<@ SAYDPR></@>||enclose a document paragraph, in the context of the existing document.|
|<@ SAYFLD>message</@>||print the contents of the field called 'message' which, in this context, is part of the 'os' recordset.|
The changed syllables translate as follows:
|<@ DEFRSTLIT>os</@>||Select every record in the database.|
|<@ LETVARSZERST>upper|___</@>||assign to the variable 'upper' the size of the default (marked by three underscores) recordset.|
|<@ RSTCAP>select * from os where cardid = <@ SAYRANVAR>upper</@></@>||Select a new recordset, capturing the output from RAN but using the variable 'upper' to specify the limit.|
|<@ ACTMOVRANRST></@>||move the record pointer to a random place in the recordset.|
Questions and AnswersI can't see a main() anywhere. Where's the start?
Protium implements a single-pass code evaluation model. This is quite unlike most other languages which implement double-pass code evaluation: first pass to discover and make a map; second pass to evaluate.
Protium starts at the beginning of a named file, and builds its awareness of context from there. Because of this approach, we may never examine code we aren't interested in.
I keep using the same construction over and over again. Is there a way of abbreviating Protium words?
What you can do is create a compound operator (a concept borrowed from OPS-3). These are defined using the KOP syllable. If you wanted to define LVK as a shorthand for LETVARKEY, for example, then you would code
Thereafter you would be able to use the abbreviated form, replacing code like with
There are other ways of doing this, including UDS (user-defined syllable) and BLK (code block), but this is by far the simplest.
© Copyright Bruce M. Axtens, 2008