Local static: 

> Here's one approach, which could be made better:
> >> f: function [] [ls] [if none? ls [ls: [0]] ls/1: ls/1 + 1 print ls/1]

  Nice one. Kind of like the old e f e g approach... I've still got
one other sort of different way to do it.
 
> >    2.  Can you create a line of REBOL code, including two or more
> functions of arity one or more (that take one or more parameters), that
> results in the same result forwards or backwards?
> 
> My answer is: write a dataflow program in REBOL. Then the lines of code can
> be shuffled or reversed with no change to the program.

   I was also thinking it would be interesting (kooky) to use
load/next and do/next to make a backwards REBOL interpreter.  The
scripts might have to be prepared to be read backwards first.

   Has anyone put to good use do/next, load/next ? 

   Just finished a solution for the Fibonacci parse rule.  Mine's kind
of klugy, though.

   Here's a puzzle:  What do you use to-none for?

   A small but potentially fun project:  Parse rule which can perform
simple derivatives: 

  parse "2x^3" deriv-rule 

  prints "6x^2" 

        -jeff

  

Reply via email to