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

Re: [StrongED] StrongED scripts; a problem.



On 15 Jan 2013  Gavin Wraith <gavin@xxxxxxxxxxxxxxx> wrote:

> In message <f820a00e53.Iyonix@xxxxxxxxxxxxxxxxxxx> you wrote:

>> In message <14fb880e53.pnyoung@xxxxxxxxxxxxxxxxxxxx>
>>           Peter Young <pnyoung@xxxxxxxxxxxx> wrote:
>> <snip>
>>> lua550 <StrongED$Script_Script>4: cannot open file
>>> 'StrongED$Script_Infile' <File
>>> 'SCSI::Armini.$.Boot.Resources.!Scrap.Scrapdirs.Scrapdir.StrongED.out'.
>>> not found
>> <snip>

> I suspect that the romnum script crashing is the reason for this.
> It was written for an earlier version of RiscLua. Try this update
> on a text that starts with a Roman numeral:

>     #! lua
>     -- Roman Numerals
>     local add = \ (x, y) => x + y end
>     local P, Cf, Cc in lpeg
>     local symbs = { I = 1, V = 5, X = 10, L = 50,
>     C = 100, D = 500, M = 1000, IV = 4, IX = 9,
>     XL = 40, XC = 90, CD = 400, CM = 900 }
>     for s, n in pairs (symbs) do
>       _ENV[s:lower ( )] = P (s) * Cc (n)
>     end -- for
>     local MS = m^0
>     local CS = ( d * c^(-4) + cd + cm + c^(-4) )^(-1)
>     local XS = ( l * x^(-4) + xl + xc + x^(-4) )^(-1)
>     local IS = ( v * i^(-4) + ix + iv + i^(-4) )^(-1)
>     local rom = MS * CS * XS * IS
>     local pat = Cf (Cc (0) * rom, add)
>     local input, read in io
>     input (arg[1])
>     local s = read "*a"
>     input ( )
>     local result = pat:match (s: upper ( ))
>     print (result or "?")

Yes, that's done it, many thanks. I've run out of time for the next 48 
hours or so, but will do some more experimenting with some other 
scripts in due course.

With best wishes,

Peter.

-- 
Peter Young (zfc Ta) and family
Prestbury, Cheltenham, Glos. GL52, England
http://pnyoung.orpheusweb.co.uk
pnyoung@xxxxxxxxxxxx

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx