[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripts



In message <583f9ba7b6Lists@xxxxxxxxxxx>
          "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

>I think the supplied Scripts need a tidy to ones which are relatively 
>easily made usable? And if they don't work - why include them?

I agree.

Some history: Back in the 1990s I ported three versions of awk to
RISC OS, and had an exchange of emails with Fred Graute about
making it easier to apply awk to change the contents of a StrongED
window. The upshot was that Fred extended StrongED to react to drags
onto the smarticon-bar in a StrongED window, added a system variable
now called StrongED$Tmp_DragFile, and added new function-indices
s-drag, c-drag and cs-drag for use in modefiles. Using these with
the Process command (see StrongED's Help->Reference section) enabled
one to apply an awk script to the contents of a StrongED window. All
this had nothing particular to do with awk, of course. Eventually
I gave up using awk and concentrated my efforts on Lua, which
can do everything that can be done with awk. Any appropriate
language would do, so long as StrongED could 1) determine which language
2) know what Obeyfile to use to apply the script, and 3) the language
had facilities for reading its commandline and writing out to a file.
The first problem is solved by the files Despatch, ftype and language in
        Defaults.Tools.!ScriptSED.Tools
and the second by the Obeyfiles in
         Defaults.Tools.!ScriptSED.Languages
which can be seen as a minidatabase for what scripting languages are
available. Originally this was all that was needed. To apply a
script you had to drag it onto the apply icon, so long as your
system had the language installed and the appropriate obeyfile
in Languages. An extra layer of complication was later added by Fred,
using AppBasic, to give the user an alternative, menu-driven, way of
applying the (off-the-peg) scripts stored in
        Defaults.Tools.!ScriptSED.Scripts
.
For myself I tend to make up scripts on the fly, and store them
elsewhere if I think them worth storing. The problem with
the off-the-peg approach is that it loads onto Fred the job of
keeping the scripts up to date , which is infeasible. For that reason
I believe it would be more sensible to revert to the earlier system,
unless users feel they cannot cope without a menu-driven interface.

A much better system for off-the-peg scripts would be for each maintainer
of a scripting language to provide a URL for a webpage about the
language, together with documentation about the scripts and links to
click on for downloading them. These URLs could then be given in StrongED's
help documentation.

--
Gavin Wraith (gavin@xxxxxxxxxxxxxxx)
Home page: http://www.wra1th.plus.com/