Scripting competition

Jerry J jhj at jhj.com
Wed May 13 22:16:29 EDT 2009


On May 12, 2009, at 2:23 PM, Jim Bufalini wrote:

> What I think is really significant about what Jerry did is that it
> demonstrates how because numbers in Rev are really "strings" that  
> you can
> perform math calculations on, and ability to interchangeably treat a  
> chunk
> as numeric or string (due to the lack of typing), Rev is able to  
> transcend
> the limitations of the math processor of a machine!

That really is the whole point, and Mark Wieder and Brian Yennie also  
solved it that way. I had a long commute today and I was thinking  
about how the inner loop had to go backwards, and the answers had to  
be created by stuffing chars before strings. So, in order to use  
repeat for each, and to stuff chars after the strings (which is  
usually faster), I figure why not have the numbers all backwards (LSD  
first) and then just reverse the answer once at the end? Well it does  
speed things up a little. Into your message box:
go URL "http://jhjensen.com/calcFibsBack.rev"

However, its even more confusing to read and figure out what's going  
on. I think, actually, if this was production code, I'd leave it  
forwards in case I ever had to modify it. That is one big advantage of  
Rev, after all. If all I cared about was speed, I'd write it in C.

I promise I'll leave it alone now. 8-)

-- Jerry J




More information about the use-livecode mailing list